id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
159,300 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | FinishSyncLocked | func (fbo *folderBlockOps) FinishSyncLocked(
ctx context.Context, lState *kbfssync.LockState,
oldPath, newPath data.Path, md ReadOnlyRootMetadata,
syncState fileSyncState, fbm *folderBlockManager) (
stillDirty bool, err error) {
fbo.blockLock.AssertLocked(lState)
dirtyBcache := fbo.config.DirtyBlockCache()
for ... | go | func (fbo *folderBlockOps) FinishSyncLocked(
ctx context.Context, lState *kbfssync.LockState,
oldPath, newPath data.Path, md ReadOnlyRootMetadata,
syncState fileSyncState, fbm *folderBlockManager) (
stillDirty bool, err error) {
fbo.blockLock.AssertLocked(lState)
dirtyBcache := fbo.config.DirtyBlockCache()
for ... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"FinishSyncLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"oldPath",
",",
"newPath",
"data",
".",
"Path",
",",
"md",
"ReadOnlyRootMetadata",
",",
"syncSta... | // FinishSyncLocked finishes the sync process for a file, given the
// state from StartSync. Specifically, it re-applies any writes that
// happened since the call to StartSync. | [
"FinishSyncLocked",
"finishes",
"the",
"sync",
"process",
"for",
"a",
"file",
"given",
"the",
"state",
"from",
"StartSync",
".",
"Specifically",
"it",
"re",
"-",
"applies",
"any",
"writes",
"that",
"happened",
"since",
"the",
"call",
"to",
"StartSync",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2949-L2997 |
159,301 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | notifyErrListenersLocked | func (fbo *folderBlockOps) notifyErrListenersLocked(
lState *kbfssync.LockState, ptr data.BlockPointer, err error) {
fbo.blockLock.AssertLocked(lState)
if isRecoverableBlockError(err) {
// Don't bother any listeners with this error, since the sync
// will be retried. Unless the sync has reached its retry
// l... | go | func (fbo *folderBlockOps) notifyErrListenersLocked(
lState *kbfssync.LockState, ptr data.BlockPointer, err error) {
fbo.blockLock.AssertLocked(lState)
if isRecoverableBlockError(err) {
// Don't bother any listeners with this error, since the sync
// will be retried. Unless the sync has reached its retry
// l... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"notifyErrListenersLocked",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"ptr",
"data",
".",
"BlockPointer",
",",
"err",
"error",
")",
"{",
"fbo",
".",
"blockLock",
".",
"AssertLocked",
"(",
"lState",... | // notifyErrListeners notifies any write operations that are blocked
// on a file so that they can learn about unrecoverable sync errors. | [
"notifyErrListeners",
"notifies",
"any",
"write",
"operations",
"that",
"are",
"blocked",
"on",
"a",
"file",
"so",
"that",
"they",
"can",
"learn",
"about",
"unrecoverable",
"sync",
"errors",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3001-L3016 |
159,302 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | searchForNodesInDirLocked | func (fbo *folderBlockOps) searchForNodesInDirLocked(ctx context.Context,
lState *kbfssync.LockState, cache NodeCache, newPtrs map[data.BlockPointer]bool,
kmd libkey.KeyMetadata, rootNode Node, currDir data.Path, nodeMap map[data.BlockPointer]Node,
numNodesFoundSoFar int) (int, error) {
fbo.blockLock.AssertAnyLocke... | go | func (fbo *folderBlockOps) searchForNodesInDirLocked(ctx context.Context,
lState *kbfssync.LockState, cache NodeCache, newPtrs map[data.BlockPointer]bool,
kmd libkey.KeyMetadata, rootNode Node, currDir data.Path, nodeMap map[data.BlockPointer]Node,
numNodesFoundSoFar int) (int, error) {
fbo.blockLock.AssertAnyLocke... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"searchForNodesInDirLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"cache",
"NodeCache",
",",
"newPtrs",
"map",
"[",
"data",
".",
"BlockPointer",
"]",
"bo... | // searchForNodesInDirLocked recursively tries to find a path, and
// ultimately a node, to ptr, given the set of pointers that were
// updated in a particular operation. The keys in nodeMap make up the
// set of BlockPointers that are being searched for, and nodeMap is
// updated in place to include the corresponding... | [
"searchForNodesInDirLocked",
"recursively",
"tries",
"to",
"find",
"a",
"path",
"and",
"ultimately",
"a",
"node",
"to",
"ptr",
"given",
"the",
"set",
"of",
"pointers",
"that",
"were",
"updated",
"in",
"a",
"particular",
"operation",
".",
"The",
"keys",
"in",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3035-L3114 |
159,303 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | SearchForPaths | func (fbo *folderBlockOps) SearchForPaths(ctx context.Context,
cache NodeCache, ptrs []data.BlockPointer, newPtrs map[data.BlockPointer]bool,
kmd libkey.KeyMetadata, rootPtr data.BlockPointer) (map[data.BlockPointer]data.Path, error) {
lState := makeFBOLockState()
// Hold the lock while processing the paths so they... | go | func (fbo *folderBlockOps) SearchForPaths(ctx context.Context,
cache NodeCache, ptrs []data.BlockPointer, newPtrs map[data.BlockPointer]bool,
kmd libkey.KeyMetadata, rootPtr data.BlockPointer) (map[data.BlockPointer]data.Path, error) {
lState := makeFBOLockState()
// Hold the lock while processing the paths so they... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"SearchForPaths",
"(",
"ctx",
"context",
".",
"Context",
",",
"cache",
"NodeCache",
",",
"ptrs",
"[",
"]",
"data",
".",
"BlockPointer",
",",
"newPtrs",
"map",
"[",
"data",
".",
"BlockPointer",
"]",
"bool",
... | // SearchForPaths is like SearchForNodes, except it returns a
// consistent view of all the paths of the searched-for pointers. | [
"SearchForPaths",
"is",
"like",
"SearchForNodes",
"except",
"it",
"returns",
"a",
"consistent",
"view",
"of",
"all",
"the",
"paths",
"of",
"the",
"searched",
"-",
"for",
"pointers",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3261-L3290 |
159,304 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | UpdateCachedEntryAttributesOnRemovedFile | func (fbo *folderBlockOps) UpdateCachedEntryAttributesOnRemovedFile(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, op *setAttrOp, p data.Path, de data.DirEntry) error {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
_, err := fbo.setCachedAttrLocked(
ctx, lState... | go | func (fbo *folderBlockOps) UpdateCachedEntryAttributesOnRemovedFile(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, op *setAttrOp, p data.Path, de data.DirEntry) error {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
_, err := fbo.setCachedAttrLocked(
ctx, lState... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"UpdateCachedEntryAttributesOnRemovedFile",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"op",
"*",
"setAttrOp",
",",
"p",
... | // UpdateCachedEntryAttributesOnRemovedFile updates any cached entry
// for the given path of an unlinked file, according to the given op,
// and it makes a new dirty cache entry if one doesn't exist yet. We
// assume Sync will be called eventually on the corresponding open
// file handle, which will clear out the ent... | [
"UpdateCachedEntryAttributesOnRemovedFile",
"updates",
"any",
"cached",
"entry",
"for",
"the",
"given",
"path",
"of",
"an",
"unlinked",
"file",
"according",
"to",
"the",
"given",
"op",
"and",
"it",
"makes",
"a",
"new",
"dirty",
"cache",
"entry",
"if",
"one",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3297-L3305 |
159,305 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | UpdatePointers | func (fbo *folderBlockOps) UpdatePointers(
kmd libkey.KeyMetadata, lState *kbfssync.LockState, op op, shouldPrefetch bool,
afterUpdateFn func() error) (affectedNodeIDs []NodeID, err error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
for _, update := range op.allUpdates() {
updatedNode := fbo.... | go | func (fbo *folderBlockOps) UpdatePointers(
kmd libkey.KeyMetadata, lState *kbfssync.LockState, op op, shouldPrefetch bool,
afterUpdateFn func() error) (affectedNodeIDs []NodeID, err error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
for _, update := range op.allUpdates() {
updatedNode := fbo.... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"UpdatePointers",
"(",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"op",
"op",
",",
"shouldPrefetch",
"bool",
",",
"afterUpdateFn",
"func",
"(",
")",
"error",
"... | // UpdatePointers updates all the pointers in the node cache
// atomically. If `afterUpdateFn` is non-nil, it's called under the
// same block lock under which the pointers were updated. | [
"UpdatePointers",
"updates",
"all",
"the",
"pointers",
"in",
"the",
"node",
"cache",
"atomically",
".",
"If",
"afterUpdateFn",
"is",
"non",
"-",
"nil",
"it",
"s",
"called",
"under",
"the",
"same",
"block",
"lock",
"under",
"which",
"the",
"pointers",
"were",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3352-L3375 |
159,306 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | FastForwardAllNodes | func (fbo *folderBlockOps) FastForwardAllNodes(ctx context.Context,
lState *kbfssync.LockState, md ReadOnlyRootMetadata) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
// Take a hard lock through this whole process. ... | go | func (fbo *folderBlockOps) FastForwardAllNodes(ctx context.Context,
lState *kbfssync.LockState, md ReadOnlyRootMetadata) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
// Take a hard lock through this whole process. ... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"FastForwardAllNodes",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"md",
"ReadOnlyRootMetadata",
")",
"(",
"changes",
"[",
"]",
"NodeChange",
",",
"affectedNodeID... | // FastForwardAllNodes attempts to update the block pointers
// associated with nodes in the cache by searching for their paths in
// the current version of the TLF. If it can't find a corresponding
// node, it assumes it's been deleted and unlinks it. Returns the set
// of node changes that resulted. If there are n... | [
"FastForwardAllNodes",
"attempts",
"to",
"update",
"the",
"block",
"pointers",
"associated",
"with",
"nodes",
"in",
"the",
"cache",
"by",
"searching",
"for",
"their",
"paths",
"in",
"the",
"current",
"version",
"of",
"the",
"TLF",
".",
"If",
"it",
"can",
"t"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3518-L3580 |
159,307 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetInvalidationChangesForNode | func (fbo *folderBlockOps) GetInvalidationChangesForNode(
ctx context.Context, lState *kbfssync.LockState, node Node) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unl... | go | func (fbo *folderBlockOps) GetInvalidationChangesForNode(
ctx context.Context, lState *kbfssync.LockState, node Node) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unl... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetInvalidationChangesForNode",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"node",
"Node",
")",
"(",
"changes",
"[",
"]",
"NodeChange",
",",
"affectedNodeIDs",
... | // GetInvalidationChangesForNode returns the list of invalidation
// notifications for all the nodes rooted at the given node. | [
"GetInvalidationChangesForNode",
"returns",
"the",
"list",
"of",
"invalidation",
"notifications",
"for",
"all",
"the",
"nodes",
"rooted",
"at",
"the",
"given",
"node",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3618-L3636 |
159,308 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetInvalidationChangesForAll | func (fbo *folderBlockOps) GetInvalidationChangesForAll(
ctx context.Context, lState *kbfssync.LockState) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
... | go | func (fbo *folderBlockOps) GetInvalidationChangesForAll(
ctx context.Context, lState *kbfssync.LockState) (
changes []NodeChange, affectedNodeIDs []NodeID, err error) {
if fbo.nodeCache == nil {
// Nothing needs to be done!
return nil, nil, nil
}
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetInvalidationChangesForAll",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
")",
"(",
"changes",
"[",
"]",
"NodeChange",
",",
"affectedNodeIDs",
"[",
"]",
"NodeID",
... | // GetInvalidationChangesForAll returns the list of invalidation
// notifications for the entire TLF. | [
"GetInvalidationChangesForAll",
"returns",
"the",
"list",
"of",
"invalidation",
"notifications",
"for",
"the",
"entire",
"TLF",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3640-L3653 |
159,309 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | MarkNode | func (fbo *folderBlockOps) MarkNode(
ctx context.Context, lState *kbfssync.LockState, node Node, kmd libkey.KeyMetadata,
tag string, cacheType DiskBlockCacheType) error {
dbc := fbo.config.DiskBlockCache()
if dbc == nil {
return nil
}
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
chargedTo... | go | func (fbo *folderBlockOps) MarkNode(
ctx context.Context, lState *kbfssync.LockState, node Node, kmd libkey.KeyMetadata,
tag string, cacheType DiskBlockCacheType) error {
dbc := fbo.config.DiskBlockCache()
if dbc == nil {
return nil
}
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
chargedTo... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"MarkNode",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"node",
"Node",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"tag",
"string",
",",
"cacheType",
"D... | // MarkNode marks all the blocks in the node's block tree with the
// given tag. | [
"MarkNode",
"marks",
"all",
"the",
"blocks",
"in",
"the",
"node",
"s",
"block",
"tree",
"with",
"the",
"given",
"tag",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3657-L3699 |
159,310 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | populateChainPaths | func (fbo *folderBlockOps) populateChainPaths(ctx context.Context,
log logger.Logger, chains *crChains, includeCreates bool) error {
_, err := chains.getPaths(
ctx, fbo, log, fbo.nodeCache, includeCreates,
fbo.config.Mode().IsTestMode())
return err
} | go | func (fbo *folderBlockOps) populateChainPaths(ctx context.Context,
log logger.Logger, chains *crChains, includeCreates bool) error {
_, err := chains.getPaths(
ctx, fbo, log, fbo.nodeCache, includeCreates,
fbo.config.Mode().IsTestMode())
return err
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"populateChainPaths",
"(",
"ctx",
"context",
".",
"Context",
",",
"log",
"logger",
".",
"Logger",
",",
"chains",
"*",
"crChains",
",",
"includeCreates",
"bool",
")",
"error",
"{",
"_",
",",
"err",
":=",
"ch... | // populateChainPaths updates all the paths in all the ops tracked by
// `chains`, using the main nodeCache. | [
"populateChainPaths",
"updates",
"all",
"the",
"paths",
"in",
"all",
"the",
"ops",
"tracked",
"by",
"chains",
"using",
"the",
"main",
"nodeCache",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L3707-L3713 |
159,311 | keybase/client | go/chat/localizer.go | checkRekeyError | func (s *localizerPipeline) checkRekeyError(ctx context.Context, fromErr error, conversationRemote chat1.Conversation, unverifiedTLFName string) *chat1.ConversationErrorLocal {
if fromErr == nil {
return nil
}
convErr, err2 := s.checkRekeyErrorInner(ctx, fromErr, conversationRemote, unverifiedTLFName)
if err2 != ... | go | func (s *localizerPipeline) checkRekeyError(ctx context.Context, fromErr error, conversationRemote chat1.Conversation, unverifiedTLFName string) *chat1.ConversationErrorLocal {
if fromErr == nil {
return nil
}
convErr, err2 := s.checkRekeyErrorInner(ctx, fromErr, conversationRemote, unverifiedTLFName)
if err2 != ... | [
"func",
"(",
"s",
"*",
"localizerPipeline",
")",
"checkRekeyError",
"(",
"ctx",
"context",
".",
"Context",
",",
"fromErr",
"error",
",",
"conversationRemote",
"chat1",
".",
"Conversation",
",",
"unverifiedTLFName",
"string",
")",
"*",
"chat1",
".",
"Conversation... | // Checks fromErr to see if it is a rekey error.
// Returns a ConversationErrorLocal if it is a rekey error.
// Returns nil otherwise. | [
"Checks",
"fromErr",
"to",
"see",
"if",
"it",
"is",
"a",
"rekey",
"error",
".",
"Returns",
"a",
"ConversationErrorLocal",
"if",
"it",
"is",
"a",
"rekey",
"error",
".",
"Returns",
"nil",
"otherwise",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/localizer.go#L916-L931 |
159,312 | keybase/client | go/kbfs/libpages/root.go | setRoot | func setRoot(root *Root, str string) error {
switch {
case strings.HasPrefix(str, privatePrefix):
root.TlfType = tlf.Private
setRootTlfNameAndPath(root, str[len(privatePrefix):])
return nil
case strings.HasPrefix(str, publicPrefix):
root.TlfType = tlf.Public
setRootTlfNameAndPath(root, str[len(publicPrefix... | go | func setRoot(root *Root, str string) error {
switch {
case strings.HasPrefix(str, privatePrefix):
root.TlfType = tlf.Private
setRootTlfNameAndPath(root, str[len(privatePrefix):])
return nil
case strings.HasPrefix(str, publicPrefix):
root.TlfType = tlf.Public
setRootTlfNameAndPath(root, str[len(publicPrefix... | [
"func",
"setRoot",
"(",
"root",
"*",
"Root",
",",
"str",
"string",
")",
"error",
"{",
"switch",
"{",
"case",
"strings",
".",
"HasPrefix",
"(",
"str",
",",
"privatePrefix",
")",
":",
"root",
".",
"TlfType",
"=",
"tlf",
".",
"Private",
"\n",
"setRootTlfN... | // str is everything after either gitPrefix or kbfsPrefix. | [
"str",
"is",
"everything",
"after",
"either",
"gitPrefix",
"or",
"kbfsPrefix",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/root.go#L195-L212 |
159,313 | keybase/client | go/kbfs/libpages/root.go | ParseRoot | func ParseRoot(str string) (Root, error) {
str = strings.TrimSpace(str)
switch {
case strings.HasPrefix(str, gitPrefix):
root := Root{Type: GitRoot}
if err := setRoot(&root, str[len(gitPrefix):]); err != nil {
return Root{}, err
}
return root, nil
case strings.HasPrefix(str, kbfsPrefix):
root := Root{T... | go | func ParseRoot(str string) (Root, error) {
str = strings.TrimSpace(str)
switch {
case strings.HasPrefix(str, gitPrefix):
root := Root{Type: GitRoot}
if err := setRoot(&root, str[len(gitPrefix):]); err != nil {
return Root{}, err
}
return root, nil
case strings.HasPrefix(str, kbfsPrefix):
root := Root{T... | [
"func",
"ParseRoot",
"(",
"str",
"string",
")",
"(",
"Root",
",",
"error",
")",
"{",
"str",
"=",
"strings",
".",
"TrimSpace",
"(",
"str",
")",
"\n",
"switch",
"{",
"case",
"strings",
".",
"HasPrefix",
"(",
"str",
",",
"gitPrefix",
")",
":",
"root",
... | // ParseRoot parses a kbp= TXT record from a domain into a Root object. | [
"ParseRoot",
"parses",
"a",
"kbp",
"=",
"TXT",
"record",
"from",
"a",
"domain",
"into",
"a",
"Root",
"object",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/root.go#L215-L234 |
159,314 | keybase/client | go/teams/resolve.go | ResolveIDToName | func ResolveIDToName(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error) {
return resolveIDToName(ctx, g, id, false)
} | go | func ResolveIDToName(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error) {
return resolveIDToName(ctx, g, id, false)
} | [
"func",
"ResolveIDToName",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"id",
"keybase1",
".",
"TeamID",
")",
"(",
"name",
"keybase1",
".",
"TeamName",
",",
"err",
"error",
")",
"{",
"return",
"resolveIDToName",... | // ResolveIDToName takes a team ID and resolves it to a name.
// It can use server-assist but always cryptographically checks the result. | [
"ResolveIDToName",
"takes",
"a",
"team",
"ID",
"and",
"resolves",
"it",
"to",
"a",
"name",
".",
"It",
"can",
"use",
"server",
"-",
"assist",
"but",
"always",
"cryptographically",
"checks",
"the",
"result",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L18-L20 |
159,315 | keybase/client | go/teams/resolve.go | ResolveIDToNameForceRefresh | func ResolveIDToNameForceRefresh(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error) {
return resolveIDToName(ctx, g, id, true)
} | go | func ResolveIDToNameForceRefresh(ctx context.Context, g *libkb.GlobalContext, id keybase1.TeamID) (name keybase1.TeamName, err error) {
return resolveIDToName(ctx, g, id, true)
} | [
"func",
"ResolveIDToNameForceRefresh",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"id",
"keybase1",
".",
"TeamID",
")",
"(",
"name",
"keybase1",
".",
"TeamName",
",",
"err",
"error",
")",
"{",
"return",
"resol... | // ResolveIDToNameForceRefresh is like ResolveIDToName but forces a refresh of
// the FTL cache. | [
"ResolveIDToNameForceRefresh",
"is",
"like",
"ResolveIDToName",
"but",
"forces",
"a",
"refresh",
"of",
"the",
"FTL",
"cache",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L24-L26 |
159,316 | keybase/client | go/teams/resolve.go | ResolveNameToID | func ResolveNameToID(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error) {
return resolveNameToID(ctx, g, name, false)
} | go | func ResolveNameToID(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error) {
return resolveNameToID(ctx, g, name, false)
} | [
"func",
"ResolveNameToID",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"name",
"keybase1",
".",
"TeamName",
")",
"(",
"id",
"keybase1",
".",
"TeamID",
",",
"err",
"error",
")",
"{",
"return",
"resolveNameToID",... | // ResolveNameToID takes a team name and resolves it to a team ID.
// It can use server-assist but always cryptographically checks the result. | [
"ResolveNameToID",
"takes",
"a",
"team",
"name",
"and",
"resolves",
"it",
"to",
"a",
"team",
"ID",
".",
"It",
"can",
"use",
"server",
"-",
"assist",
"but",
"always",
"cryptographically",
"checks",
"the",
"result",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L44-L46 |
159,317 | keybase/client | go/teams/resolve.go | ResolveNameToIDForceRefresh | func ResolveNameToIDForceRefresh(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error) {
return resolveNameToID(ctx, g, name, true)
} | go | func ResolveNameToIDForceRefresh(ctx context.Context, g *libkb.GlobalContext, name keybase1.TeamName) (id keybase1.TeamID, err error) {
return resolveNameToID(ctx, g, name, true)
} | [
"func",
"ResolveNameToIDForceRefresh",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"name",
"keybase1",
".",
"TeamName",
")",
"(",
"id",
"keybase1",
".",
"TeamID",
",",
"err",
"error",
")",
"{",
"return",
"resol... | // ResolveNameToIDForceRefresh is just like ResolveNameToID but it forces a refresh. | [
"ResolveNameToIDForceRefresh",
"is",
"just",
"like",
"ResolveNameToID",
"but",
"it",
"forces",
"a",
"refresh",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L49-L51 |
159,318 | keybase/client | go/teams/resolve.go | ResolveImplicitTeamDisplayName | func ResolveImplicitTeamDisplayName(ctx context.Context, g *libkb.GlobalContext,
name string, public bool) (res keybase1.ImplicitTeamDisplayName, err error) {
defer g.CTraceTimed(ctx, fmt.Sprintf("ResolveImplicitTeamDisplayName(%v, public:%v)", name, public), func() error { return err })()
split1 := strings.SplitN... | go | func ResolveImplicitTeamDisplayName(ctx context.Context, g *libkb.GlobalContext,
name string, public bool) (res keybase1.ImplicitTeamDisplayName, err error) {
defer g.CTraceTimed(ctx, fmt.Sprintf("ResolveImplicitTeamDisplayName(%v, public:%v)", name, public), func() error { return err })()
split1 := strings.SplitN... | [
"func",
"ResolveImplicitTeamDisplayName",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"name",
"string",
",",
"public",
"bool",
")",
"(",
"res",
"keybase1",
".",
"ImplicitTeamDisplayName",
",",
"err",
"error",
")",
... | // Resolve assertions in an implicit team display name and verify the result.
// Resolve an implicit team name with assertions like "alice,bob+bob@twitter#char (conflicted copy 2017-03-04 #1)"
// Into "alice,bob#char (conflicted copy 2017-03-04 #1)"
// The input can contain compound assertions, but if compound assertio... | [
"Resolve",
"assertions",
"in",
"an",
"implicit",
"team",
"display",
"name",
"and",
"verify",
"the",
"result",
".",
"Resolve",
"an",
"implicit",
"team",
"name",
"with",
"assertions",
"like",
"alice",
"bob",
"+",
"bob"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L75-L126 |
159,319 | keybase/client | go/teams/resolve.go | shouldPreventTeamCreation | func shouldPreventTeamCreation(err error) bool {
if resErr, ok := err.(libkb.ResolutionError); ok {
switch resErr.Kind {
case libkb.ResolutionErrorRateLimited, libkb.ResolutionErrorInvalidInput, libkb.ResolutionErrorRequestFailed:
return true
}
}
return false
} | go | func shouldPreventTeamCreation(err error) bool {
if resErr, ok := err.(libkb.ResolutionError); ok {
switch resErr.Kind {
case libkb.ResolutionErrorRateLimited, libkb.ResolutionErrorInvalidInput, libkb.ResolutionErrorRequestFailed:
return true
}
}
return false
} | [
"func",
"shouldPreventTeamCreation",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"resErr",
",",
"ok",
":=",
"err",
".",
"(",
"libkb",
".",
"ResolutionError",
")",
";",
"ok",
"{",
"switch",
"resErr",
".",
"Kind",
"{",
"case",
"libkb",
".",
"ResolutionErr... | // preventTeamCreationOnError checks if an error coming from resolver should
// prevent us from creating a team. We don't want a team where we don't know if
// SBS user is resolvable but we just were unable to get the answer. | [
"preventTeamCreationOnError",
"checks",
"if",
"an",
"error",
"coming",
"from",
"resolver",
"should",
"prevent",
"us",
"from",
"creating",
"a",
"team",
".",
"We",
"don",
"t",
"want",
"a",
"team",
"where",
"we",
"don",
"t",
"know",
"if",
"SBS",
"user",
"is",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L131-L139 |
159,320 | keybase/client | go/teams/resolve.go | ResolveImplicitTeamSetUntrusted | func ResolveImplicitTeamSetUntrusted(ctx context.Context, g *libkb.GlobalContext,
sourceAssertions []libkb.AssertionExpression, resSet *keybase1.ImplicitTeamUserSet, resolvedAssertions *[]libkb.ResolvedAssertion) error {
m := libkb.NewMetaContext(ctx, g)
for _, expr := range sourceAssertions {
u, resolveRes, err... | go | func ResolveImplicitTeamSetUntrusted(ctx context.Context, g *libkb.GlobalContext,
sourceAssertions []libkb.AssertionExpression, resSet *keybase1.ImplicitTeamUserSet, resolvedAssertions *[]libkb.ResolvedAssertion) error {
m := libkb.NewMetaContext(ctx, g)
for _, expr := range sourceAssertions {
u, resolveRes, err... | [
"func",
"ResolveImplicitTeamSetUntrusted",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"sourceAssertions",
"[",
"]",
"libkb",
".",
"AssertionExpression",
",",
"resSet",
"*",
"keybase1",
".",
"ImplicitTeamUserSet",
",",... | // Try to resolve implicit team members.
// Modifies the arguments `resSet` and appends to `resolvedAssertions`.
// For each assertion in `sourceAssertions`, try to resolve them.
// If they resolve, add the username to `resSet` and the assertion to `resolvedAssertions`.
// If they don't resolve, add the SocialAsser... | [
"Try",
"to",
"resolve",
"implicit",
"team",
"members",
".",
"Modifies",
"the",
"arguments",
"resSet",
"and",
"appends",
"to",
"resolvedAssertions",
".",
"For",
"each",
"assertion",
"in",
"sourceAssertions",
"try",
"to",
"resolve",
"them",
".",
"If",
"they",
"r... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L146-L180 |
159,321 | keybase/client | go/teams/resolve.go | verifyResolveResult | func verifyResolveResult(ctx context.Context, g *libkb.GlobalContext, resolvedAssertion libkb.ResolvedAssertion) (err error) {
defer g.CTrace(ctx, fmt.Sprintf("verifyResolveResult ID user [%s] %s", resolvedAssertion.UID, resolvedAssertion.Assertion.String()),
func() error { return err })()
if resolvedAssertion.Re... | go | func verifyResolveResult(ctx context.Context, g *libkb.GlobalContext, resolvedAssertion libkb.ResolvedAssertion) (err error) {
defer g.CTrace(ctx, fmt.Sprintf("verifyResolveResult ID user [%s] %s", resolvedAssertion.UID, resolvedAssertion.Assertion.String()),
func() error { return err })()
if resolvedAssertion.Re... | [
"func",
"verifyResolveResult",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"resolvedAssertion",
"libkb",
".",
"ResolvedAssertion",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"g",
".",
"CTrace",
"(",
"ctx",
",... | // Verify using Identify that a UID matches an assertion. | [
"Verify",
"using",
"Identify",
"that",
"a",
"UID",
"matches",
"an",
"assertion",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/resolve.go#L183-L220 |
159,322 | keybase/client | go/teams/loader2.go | checkStubbed | func (l *TeamLoader) checkStubbed(ctx context.Context, arg load2ArgT, link *ChainLinkUnpacked) error {
if !link.isStubbed() {
return nil
}
if l.seqnosContains(arg.needSeqnos, link.Seqno()) {
return NewStubbedErrorWithNote(link, "Need seqno")
}
if arg.needAdmin || !link.outerLink.LinkType.TeamAllowStubWithAdmin... | go | func (l *TeamLoader) checkStubbed(ctx context.Context, arg load2ArgT, link *ChainLinkUnpacked) error {
if !link.isStubbed() {
return nil
}
if l.seqnosContains(arg.needSeqnos, link.Seqno()) {
return NewStubbedErrorWithNote(link, "Need seqno")
}
if arg.needAdmin || !link.outerLink.LinkType.TeamAllowStubWithAdmin... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"checkStubbed",
"(",
"ctx",
"context",
".",
"Context",
",",
"arg",
"load2ArgT",
",",
"link",
"*",
"ChainLinkUnpacked",
")",
"error",
"{",
"if",
"!",
"link",
".",
"isStubbed",
"(",
")",
"{",
"return",
"nil",
"\n... | // checkStubbed checks if it's OK if a link is stubbed. | [
"checkStubbed",
"checks",
"if",
"it",
"s",
"OK",
"if",
"a",
"link",
"is",
"stubbed",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L105-L116 |
159,323 | keybase/client | go/teams/loader2.go | loadUserAndKeyFromLinkInnerNoVerify | func (l *TeamLoader) loadUserAndKeyFromLinkInnerNoVerify(ctx context.Context,
link *ChainLinkUnpacked) (signerUV keybase1.UserVersion, err error) {
if !ShouldSuppressLogging(ctx) {
defer l.G().CTraceTimed(ctx, fmt.Sprintf("TeamLoader#loadUserAndKeyFromLinkInnerNoVerify(%d)", int(link.inner.Seqno)), func() error { r... | go | func (l *TeamLoader) loadUserAndKeyFromLinkInnerNoVerify(ctx context.Context,
link *ChainLinkUnpacked) (signerUV keybase1.UserVersion, err error) {
if !ShouldSuppressLogging(ctx) {
defer l.G().CTraceTimed(ctx, fmt.Sprintf("TeamLoader#loadUserAndKeyFromLinkInnerNoVerify(%d)", int(link.inner.Seqno)), func() error { r... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"loadUserAndKeyFromLinkInnerNoVerify",
"(",
"ctx",
"context",
".",
"Context",
",",
"link",
"*",
"ChainLinkUnpacked",
")",
"(",
"signerUV",
"keybase1",
".",
"UserVersion",
",",
"err",
"error",
")",
"{",
"if",
"!",
"Sh... | // Get the UV from a link but using server-trust and without verifying anything. | [
"Get",
"the",
"UV",
"from",
"a",
"link",
"but",
"using",
"server",
"-",
"trust",
"and",
"without",
"verifying",
"anything",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L138-L153 |
159,324 | keybase/client | go/teams/loader2.go | verifyExplicitPermission | func (l *TeamLoader) verifyExplicitPermission(ctx context.Context, state *keybase1.TeamData,
link *ChainLinkUnpacked, uv keybase1.UserVersion, atOrAbove keybase1.TeamRole) error {
return (TeamSigChainState{state.Chain}).AssertWasRoleOrAboveAt(uv, atOrAbove, link.SigChainLocation().Sub1())
} | go | func (l *TeamLoader) verifyExplicitPermission(ctx context.Context, state *keybase1.TeamData,
link *ChainLinkUnpacked, uv keybase1.UserVersion, atOrAbove keybase1.TeamRole) error {
return (TeamSigChainState{state.Chain}).AssertWasRoleOrAboveAt(uv, atOrAbove, link.SigChainLocation().Sub1())
} | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"verifyExplicitPermission",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"link",
"*",
"ChainLinkUnpacked",
",",
"uv",
"keybase1",
".",
"UserVersion",
",",
"atOrAbove",
"... | // Verify that the user had the explicit on-chain role just before this `link`. | [
"Verify",
"that",
"the",
"user",
"had",
"the",
"explicit",
"on",
"-",
"chain",
"role",
"just",
"before",
"this",
"link",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L308-L311 |
159,325 | keybase/client | go/teams/loader2.go | walkUpToAdmin | func (l *TeamLoader) walkUpToAdmin(
ctx context.Context, team *keybase1.TeamData, me keybase1.UserVersion, readSubteamID keybase1.TeamID,
uv keybase1.UserVersion, admin SCTeamAdmin, parentsCache parentChainCache) (*TeamSigChainState, error) {
target, err := admin.TeamID.ToTeamID()
if err != nil {
return nil, err... | go | func (l *TeamLoader) walkUpToAdmin(
ctx context.Context, team *keybase1.TeamData, me keybase1.UserVersion, readSubteamID keybase1.TeamID,
uv keybase1.UserVersion, admin SCTeamAdmin, parentsCache parentChainCache) (*TeamSigChainState, error) {
target, err := admin.TeamID.ToTeamID()
if err != nil {
return nil, err... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"walkUpToAdmin",
"(",
"ctx",
"context",
".",
"Context",
",",
"team",
"*",
"keybase1",
".",
"TeamData",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"readSubteamID",
"keybase1",
".",
"TeamID",
",",
"uv",
"keybase... | // Does not return a full TeamData because it might get a subteam-reader version. | [
"Does",
"not",
"return",
"a",
"full",
"TeamData",
"because",
"it",
"might",
"get",
"a",
"subteam",
"-",
"reader",
"version",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L316-L361 |
159,326 | keybase/client | go/teams/loader2.go | verifyAdminPermissions | func (l *TeamLoader) verifyAdminPermissions(ctx context.Context,
state *keybase1.TeamData, me keybase1.UserVersion, link *ChainLinkUnpacked, readSubteamID keybase1.TeamID,
uv keybase1.UserVersion, proofSet *proofSetT, parentsCache parentChainCache) (SignerX, error) {
signer := SignerX{signer: uv}
explicitAdmin := ... | go | func (l *TeamLoader) verifyAdminPermissions(ctx context.Context,
state *keybase1.TeamData, me keybase1.UserVersion, link *ChainLinkUnpacked, readSubteamID keybase1.TeamID,
uv keybase1.UserVersion, proofSet *proofSetT, parentsCache parentChainCache) (SignerX, error) {
signer := SignerX{signer: uv}
explicitAdmin := ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"verifyAdminPermissions",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"link",
"*",
"ChainLinkUnpacked",
",",
"readSubteamID",
... | // Verify that a user has admin permissions.
// Because this uses the proofSet, if it is called may return success and fail later. | [
"Verify",
"that",
"a",
"user",
"has",
"admin",
"permissions",
".",
"Because",
"this",
"uses",
"the",
"proofSet",
"if",
"it",
"is",
"called",
"may",
"return",
"success",
"and",
"fail",
"later",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L375-L409 |
159,327 | keybase/client | go/teams/loader2.go | applyNewLink | func (l *TeamLoader) applyNewLink(ctx context.Context,
state *keybase1.TeamData, link *ChainLinkUnpacked,
signer *SignerX, me keybase1.UserVersion) (*keybase1.TeamData, error) {
ctx, tbs := l.G().CTimeBuckets(ctx)
defer tbs.Record("TeamLoader.applyNewLink")()
if !ShouldSuppressLogging(ctx) {
l.G().Log.CDebugf(c... | go | func (l *TeamLoader) applyNewLink(ctx context.Context,
state *keybase1.TeamData, link *ChainLinkUnpacked,
signer *SignerX, me keybase1.UserVersion) (*keybase1.TeamData, error) {
ctx, tbs := l.G().CTimeBuckets(ctx)
defer tbs.Record("TeamLoader.applyNewLink")()
if !ShouldSuppressLogging(ctx) {
l.G().Log.CDebugf(c... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"applyNewLink",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"link",
"*",
"ChainLinkUnpacked",
",",
"signer",
"*",
"SignerX",
",",
"me",
"keybase1",
".",
"UserVersion"... | // Apply a new link to the sigchain state.
// `state` is moved into this function. There must exist no live references into it from now on.
// `signer` may be nil iff link is stubbed. | [
"Apply",
"a",
"new",
"link",
"to",
"the",
"sigchain",
"state",
".",
"state",
"is",
"moved",
"into",
"this",
"function",
".",
"There",
"must",
"exist",
"no",
"live",
"references",
"into",
"it",
"from",
"now",
"on",
".",
"signer",
"may",
"be",
"nil",
"if... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L476-L509 |
159,328 | keybase/client | go/teams/loader2.go | inflateLink | func (l *TeamLoader) inflateLink(ctx context.Context,
state *keybase1.TeamData, link *ChainLinkUnpacked,
signer SignerX, me keybase1.UserVersion) (
*keybase1.TeamData, error) {
l.G().Log.CDebugf(ctx, "TeamLoader inflating link seqno:%v", link.Seqno())
if state == nil {
// The only reason state would be nil is ... | go | func (l *TeamLoader) inflateLink(ctx context.Context,
state *keybase1.TeamData, link *ChainLinkUnpacked,
signer SignerX, me keybase1.UserVersion) (
*keybase1.TeamData, error) {
l.G().Log.CDebugf(ctx, "TeamLoader inflating link seqno:%v", link.Seqno())
if state == nil {
// The only reason state would be nil is ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"inflateLink",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"link",
"*",
"ChainLinkUnpacked",
",",
"signer",
"SignerX",
",",
"me",
"keybase1",
".",
"UserVersion",
")",... | // Inflate a link that was stubbed with its non-stubbed data. | [
"Inflate",
"a",
"link",
"that",
"was",
"stubbed",
"with",
"its",
"non",
"-",
"stubbed",
"data",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L512-L533 |
159,329 | keybase/client | go/teams/loader2.go | checkParentChildOperations | func (l *TeamLoader) checkParentChildOperations(ctx context.Context,
me keybase1.UserVersion, loadingTeamID keybase1.TeamID, parentID *keybase1.TeamID, readSubteamID keybase1.TeamID,
parentChildOperations []*parentChildOperation, proofSet *proofSetT) error {
if len(parentChildOperations) == 0 {
return nil
}
if ... | go | func (l *TeamLoader) checkParentChildOperations(ctx context.Context,
me keybase1.UserVersion, loadingTeamID keybase1.TeamID, parentID *keybase1.TeamID, readSubteamID keybase1.TeamID,
parentChildOperations []*parentChildOperation, proofSet *proofSetT) error {
if len(parentChildOperations) == 0 {
return nil
}
if ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"checkParentChildOperations",
"(",
"ctx",
"context",
".",
"Context",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"loadingTeamID",
"keybase1",
".",
"TeamID",
",",
"parentID",
"*",
"keybase1",
".",
"TeamID",
",",
"... | // Check that the parent-child operations appear in the parent sigchains. | [
"Check",
"that",
"the",
"parent",
"-",
"child",
"operations",
"appear",
"in",
"the",
"parent",
"sigchains",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L536-L591 |
159,330 | keybase/client | go/teams/loader2.go | checkProofs | func (l *TeamLoader) checkProofs(ctx context.Context,
state *keybase1.TeamData, proofSet *proofSetT) error {
if state == nil {
return fmt.Errorf("teamloader fault: nil team for proof ordering check")
}
// Give the most up-to-date linkmap to the ordering checker.
// Without this it would fail in some cases when ... | go | func (l *TeamLoader) checkProofs(ctx context.Context,
state *keybase1.TeamData, proofSet *proofSetT) error {
if state == nil {
return fmt.Errorf("teamloader fault: nil team for proof ordering check")
}
// Give the most up-to-date linkmap to the ordering checker.
// Without this it would fail in some cases when ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"checkProofs",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"proofSet",
"*",
"proofSetT",
")",
"error",
"{",
"if",
"state",
"==",
"nil",
"{",
"return",
"fmt",
".",... | // Check all the proofs and ordering constraints in proofSet | [
"Check",
"all",
"the",
"proofs",
"and",
"ordering",
"constraints",
"in",
"proofSet"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L606-L620 |
159,331 | keybase/client | go/teams/loader2.go | addKBFSCryptKeys | func (l *TeamLoader) addKBFSCryptKeys(ctx context.Context, state *keybase1.TeamData,
upgrades []keybase1.TeamGetLegacyTLFUpgrade) error {
m := make(map[keybase1.TeamApplication][]keybase1.CryptKey)
for _, upgrade := range upgrades {
key, err := ApplicationKeyAtGeneration(libkb.NewMetaContext(ctx, l.G()), state, up... | go | func (l *TeamLoader) addKBFSCryptKeys(ctx context.Context, state *keybase1.TeamData,
upgrades []keybase1.TeamGetLegacyTLFUpgrade) error {
m := make(map[keybase1.TeamApplication][]keybase1.CryptKey)
for _, upgrade := range upgrades {
key, err := ApplicationKeyAtGeneration(libkb.NewMetaContext(ctx, l.G()), state, up... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"addKBFSCryptKeys",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"upgrades",
"[",
"]",
"keybase1",
".",
"TeamGetLegacyTLFUpgrade",
")",
"error",
"{",
"m",
":=",
"make"... | // AddKBFSCryptKeys mutates `state` | [
"AddKBFSCryptKeys",
"mutates",
"state"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L666-L698 |
159,332 | keybase/client | go/teams/loader2.go | checkReaderKeyMaskCoverage | func (l *TeamLoader) checkReaderKeyMaskCoverage(ctx context.Context,
state *keybase1.TeamData, gen keybase1.PerTeamKeyGeneration) error {
for _, app := range keybase1.TeamApplicationMap {
if app == keybase1.TeamApplication_STELLAR_RELAY {
// TODO CORE-7718 Allow clients to be missing these RKMs for now.
// ... | go | func (l *TeamLoader) checkReaderKeyMaskCoverage(ctx context.Context,
state *keybase1.TeamData, gen keybase1.PerTeamKeyGeneration) error {
for _, app := range keybase1.TeamApplicationMap {
if app == keybase1.TeamApplication_STELLAR_RELAY {
// TODO CORE-7718 Allow clients to be missing these RKMs for now.
// ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"checkReaderKeyMaskCoverage",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"gen",
"keybase1",
".",
"PerTeamKeyGeneration",
")",
"error",
"{",
"for",
"_",
",",
"app",
"... | // Check that the RKMs for a generation are covered for all apps. | [
"Check",
"that",
"the",
"RKMs",
"for",
"a",
"generation",
"are",
"covered",
"for",
"all",
"apps",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L815-L833 |
159,333 | keybase/client | go/teams/loader2.go | checkNeededSeqnos | func (l *TeamLoader) checkNeededSeqnos(ctx context.Context,
state *keybase1.TeamData, needSeqnos []keybase1.Seqno) error {
if len(needSeqnos) == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team does not contain needed seqnos")
}
for _, seqno := range needSeqnos {
if (TeamSigChainState{inner:... | go | func (l *TeamLoader) checkNeededSeqnos(ctx context.Context,
state *keybase1.TeamData, needSeqnos []keybase1.Seqno) error {
if len(needSeqnos) == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team does not contain needed seqnos")
}
for _, seqno := range needSeqnos {
if (TeamSigChainState{inner:... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"checkNeededSeqnos",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"needSeqnos",
"[",
"]",
"keybase1",
".",
"Seqno",
")",
"error",
"{",
"if",
"len",
"(",
"needSeqnos"... | // Whether the snapshot has fully loaded, non-stubbed, all of the links. | [
"Whether",
"the",
"snapshot",
"has",
"fully",
"loaded",
"non",
"-",
"stubbed",
"all",
"of",
"the",
"links",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L906-L922 |
159,334 | keybase/client | go/teams/loader2.go | calculateName | func (l *TeamLoader) calculateName(ctx context.Context,
state *keybase1.TeamData, me keybase1.UserVersion, readSubteamID keybase1.TeamID, staleOK bool) (newName keybase1.TeamName, err error) {
chain := TeamSigChainState{inner: state.Chain}
if !chain.IsSubteam() {
return chain.inner.RootAncestor, nil
}
// Load ... | go | func (l *TeamLoader) calculateName(ctx context.Context,
state *keybase1.TeamData, me keybase1.UserVersion, readSubteamID keybase1.TeamID, staleOK bool) (newName keybase1.TeamName, err error) {
chain := TeamSigChainState{inner: state.Chain}
if !chain.IsSubteam() {
return chain.inner.RootAncestor, nil
}
// Load ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"calculateName",
"(",
"ctx",
"context",
".",
"Context",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"readSubteamID",
"keybase1",
".",
"TeamID",
",",
"staleOK",
"b... | // Calculates the latest name of the team.
// The last part will be as up to date as the sigchain in state.
// The mid-team parts can be as old as the cache time, unless staleOK is false in which case they will be fetched. | [
"Calculates",
"the",
"latest",
"name",
"of",
"the",
"team",
".",
"The",
"last",
"part",
"will",
"be",
"as",
"up",
"to",
"date",
"as",
"the",
"sigchain",
"in",
"state",
".",
"The",
"mid",
"-",
"team",
"parts",
"can",
"be",
"as",
"old",
"as",
"the",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader2.go#L927-L966 |
159,335 | keybase/client | go/service/cryptocurrency.go | RegisterAddress | func (h *CryptocurrencyHandler) RegisterAddress(nctx context.Context, arg keybase1.RegisterAddressArg) (keybase1.RegisterAddressRes, error) {
uis := libkb.UIs{
LogUI: h.getLogUI(arg.SessionID),
SecretUI: h.getSecretUI(arg.SessionID, h.G()),
SessionID: arg.SessionID,
}
eng := engine.NewCryptocurrencyEngine... | go | func (h *CryptocurrencyHandler) RegisterAddress(nctx context.Context, arg keybase1.RegisterAddressArg) (keybase1.RegisterAddressRes, error) {
uis := libkb.UIs{
LogUI: h.getLogUI(arg.SessionID),
SecretUI: h.getSecretUI(arg.SessionID, h.G()),
SessionID: arg.SessionID,
}
eng := engine.NewCryptocurrencyEngine... | [
"func",
"(",
"h",
"*",
"CryptocurrencyHandler",
")",
"RegisterAddress",
"(",
"nctx",
"context",
".",
"Context",
",",
"arg",
"keybase1",
".",
"RegisterAddressArg",
")",
"(",
"keybase1",
".",
"RegisterAddressRes",
",",
"error",
")",
"{",
"uis",
":=",
"libkb",
... | // BTC creates a BTCEngine and runs it. | [
"BTC",
"creates",
"a",
"BTCEngine",
"and",
"runs",
"it",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/cryptocurrency.go#L27-L38 |
159,336 | keybase/client | go/service/notify.go | NewNotifyCtlHandler | func NewNotifyCtlHandler(xp rpc.Transporter, id libkb.ConnectionID, g *libkb.GlobalContext) *NotifyCtlHandler {
return &NotifyCtlHandler{
Contextified: libkb.NewContextified(g),
BaseHandler: NewBaseHandler(g, xp),
id: id,
}
} | go | func NewNotifyCtlHandler(xp rpc.Transporter, id libkb.ConnectionID, g *libkb.GlobalContext) *NotifyCtlHandler {
return &NotifyCtlHandler{
Contextified: libkb.NewContextified(g),
BaseHandler: NewBaseHandler(g, xp),
id: id,
}
} | [
"func",
"NewNotifyCtlHandler",
"(",
"xp",
"rpc",
".",
"Transporter",
",",
"id",
"libkb",
".",
"ConnectionID",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
")",
"*",
"NotifyCtlHandler",
"{",
"return",
"&",
"NotifyCtlHandler",
"{",
"Contextified",
":",
"libkb",... | // NewNotifyCtlHandler creates a new handler for setting up notification
// channels | [
"NewNotifyCtlHandler",
"creates",
"a",
"new",
"handler",
"for",
"setting",
"up",
"notification",
"channels"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/notify.go#L22-L28 |
159,337 | keybase/client | go/kbfs/libdokan/tlf.go | CanDeleteDirectory | func (tlf *TLF) CanDeleteDirectory(ctx context.Context, fi *dokan.FileInfo) (err error) {
return nil
} | go | func (tlf *TLF) CanDeleteDirectory(ctx context.Context, fi *dokan.FileInfo) (err error) {
return nil
} | [
"func",
"(",
"tlf",
"*",
"TLF",
")",
"CanDeleteDirectory",
"(",
"ctx",
"context",
".",
"Context",
",",
"fi",
"*",
"dokan",
".",
"FileInfo",
")",
"(",
"err",
"error",
")",
"{",
"return",
"nil",
"\n",
"}"
] | // CanDeleteDirectory - return just nil because tlfs
// can always be removed from favorites. | [
"CanDeleteDirectory",
"-",
"return",
"just",
"nil",
"because",
"tlfs",
"can",
"always",
"be",
"removed",
"from",
"favorites",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/tlf.go#L256-L258 |
159,338 | keybase/client | go/kbfs/libdokan/tlf.go | Cleanup | func (tlf *TLF) Cleanup(ctx context.Context, fi *dokan.FileInfo) {
var err error
if fi != nil && fi.IsDeleteOnClose() {
tlf.folder.handleMu.Lock()
fav := tlf.folder.h.ToFavorite()
tlf.folder.handleMu.Unlock()
tlf.folder.fs.vlog.CLogf(
ctx, libkb.VLog1, "TLF Removing favorite %q", fav.Name)
defer func() {... | go | func (tlf *TLF) Cleanup(ctx context.Context, fi *dokan.FileInfo) {
var err error
if fi != nil && fi.IsDeleteOnClose() {
tlf.folder.handleMu.Lock()
fav := tlf.folder.h.ToFavorite()
tlf.folder.handleMu.Unlock()
tlf.folder.fs.vlog.CLogf(
ctx, libkb.VLog1, "TLF Removing favorite %q", fav.Name)
defer func() {... | [
"func",
"(",
"tlf",
"*",
"TLF",
")",
"Cleanup",
"(",
"ctx",
"context",
".",
"Context",
",",
"fi",
"*",
"dokan",
".",
"FileInfo",
")",
"{",
"var",
"err",
"error",
"\n",
"if",
"fi",
"!=",
"nil",
"&&",
"fi",
".",
"IsDeleteOnClose",
"(",
")",
"{",
"t... | // Cleanup - forget references, perform deletions etc. | [
"Cleanup",
"-",
"forget",
"references",
"perform",
"deletions",
"etc",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/tlf.go#L261-L282 |
159,339 | keybase/client | go/chat/unfurl/scrape_generic_scoring.go | getAppleTouchFaviconScore | func getAppleTouchFaviconScore(domain string, e *colly.HTMLElement) int {
return (getDefaultScore(domain, e) + 1) * getFaviconMultiplier(e)
} | go | func getAppleTouchFaviconScore(domain string, e *colly.HTMLElement) int {
return (getDefaultScore(domain, e) + 1) * getFaviconMultiplier(e)
} | [
"func",
"getAppleTouchFaviconScore",
"(",
"domain",
"string",
",",
"e",
"*",
"colly",
".",
"HTMLElement",
")",
"int",
"{",
"return",
"(",
"getDefaultScore",
"(",
"domain",
",",
"e",
")",
"+",
"1",
")",
"*",
"getFaviconMultiplier",
"(",
"e",
")",
"\n",
"}... | // Favor apple-touch-icon over other favicons, try to get the highest
// resolution. | [
"Favor",
"apple",
"-",
"touch",
"-",
"icon",
"over",
"other",
"favicons",
"try",
"to",
"get",
"the",
"highest",
"resolution",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/unfurl/scrape_generic_scoring.go#L75-L77 |
159,340 | keybase/client | go/kbfs/libkbfs/folder_branch_status.go | setRootMetadata | func (fbsk *folderBranchStatusKeeper) setRootMetadata(md ImmutableRootMetadata) {
fbsk.dataMutex.Lock()
defer fbsk.dataMutex.Unlock()
if fbsk.md.MdID() == md.MdID() {
return
}
fbsk.md = md
fbsk.signalChangeLocked()
} | go | func (fbsk *folderBranchStatusKeeper) setRootMetadata(md ImmutableRootMetadata) {
fbsk.dataMutex.Lock()
defer fbsk.dataMutex.Unlock()
if fbsk.md.MdID() == md.MdID() {
return
}
fbsk.md = md
fbsk.signalChangeLocked()
} | [
"func",
"(",
"fbsk",
"*",
"folderBranchStatusKeeper",
")",
"setRootMetadata",
"(",
"md",
"ImmutableRootMetadata",
")",
"{",
"fbsk",
".",
"dataMutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"fbsk",
".",
"dataMutex",
".",
"Unlock",
"(",
")",
"\n",
"if",
"fbsk... | // setRootMetadata sets the current head metadata for the
// corresponding folder-branch. | [
"setRootMetadata",
"sets",
"the",
"current",
"head",
"metadata",
"for",
"the",
"corresponding",
"folder",
"-",
"branch",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_branch_status.go#L127-L135 |
159,341 | keybase/client | go/kbfs/libkbfs/folder_branch_status.go | getStatus | func (fbsk *folderBranchStatusKeeper) getStatus(ctx context.Context,
blocks *folderBlockOps) (FolderBranchStatus, <-chan StatusUpdate, error) {
fbs, ch, tlfID, err := fbsk.getStatusWithoutJournaling(ctx)
if err != nil {
return FolderBranchStatus{}, nil, err
}
if tlfID == tlf.NullID {
return fbs, ch, nil
}
/... | go | func (fbsk *folderBranchStatusKeeper) getStatus(ctx context.Context,
blocks *folderBlockOps) (FolderBranchStatus, <-chan StatusUpdate, error) {
fbs, ch, tlfID, err := fbsk.getStatusWithoutJournaling(ctx)
if err != nil {
return FolderBranchStatus{}, nil, err
}
if tlfID == tlf.NullID {
return fbs, ch, nil
}
/... | [
"func",
"(",
"fbsk",
"*",
"folderBranchStatusKeeper",
")",
"getStatus",
"(",
"ctx",
"context",
".",
"Context",
",",
"blocks",
"*",
"folderBlockOps",
")",
"(",
"FolderBranchStatus",
",",
"<-",
"chan",
"StatusUpdate",
",",
"error",
")",
"{",
"fbs",
",",
"ch",
... | // getStatus returns a FolderBranchStatus-representation of the
// current status. If blocks != nil, the paths of any unflushed files
// in the journals will be included in the status. The returned
// channel is closed whenever the status changes, except for journal
// status changes. | [
"getStatus",
"returns",
"a",
"FolderBranchStatus",
"-",
"representation",
"of",
"the",
"current",
"status",
".",
"If",
"blocks",
"!",
"=",
"nil",
"the",
"paths",
"of",
"any",
"unflushed",
"files",
"in",
"the",
"journals",
"will",
"be",
"included",
"in",
"the... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_branch_status.go#L305-L342 |
159,342 | keybase/client | go/kbfs/data/block_tree.go | processGetBlocksTask | func (bt *blockTree) processGetBlocksTask(ctx context.Context,
wg *sync.WaitGroup, wp *workerpool.WorkerPool,
job getBlocksForOffsetRangeTask,
results chan<- getBlocksForOffsetRangeResult) {
defer wg.Done()
select {
case <-ctx.Done():
results <- getBlocksForOffsetRangeResult{err: ctx.Err()}
return
default:
... | go | func (bt *blockTree) processGetBlocksTask(ctx context.Context,
wg *sync.WaitGroup, wp *workerpool.WorkerPool,
job getBlocksForOffsetRangeTask,
results chan<- getBlocksForOffsetRangeResult) {
defer wg.Done()
select {
case <-ctx.Done():
results <- getBlocksForOffsetRangeResult{err: ctx.Err()}
return
default:
... | [
"func",
"(",
"bt",
"*",
"blockTree",
")",
"processGetBlocksTask",
"(",
"ctx",
"context",
".",
"Context",
",",
"wg",
"*",
"sync",
".",
"WaitGroup",
",",
"wp",
"*",
"workerpool",
".",
"WorkerPool",
",",
"job",
"getBlocksForOffsetRangeTask",
",",
"results",
"ch... | // processGetBlocksTask examines the block it is passed, enqueueing any children
// in range into wp, and passing data back through results. | [
"processGetBlocksTask",
"examines",
"the",
"block",
"it",
"is",
"passed",
"enqueueing",
"any",
"children",
"in",
"range",
"into",
"wp",
"and",
"passing",
"data",
"back",
"through",
"results",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/block_tree.go#L327-L431 |
159,343 | keybase/client | go/kbfs/data/block_tree.go | markParentsDirty | func (bt *blockTree) markParentsDirty(
ctx context.Context, parentBlocks []ParentBlockAndChildIndex) (
dirtyPtrs []BlockPointer, unrefs []BlockInfo, err error) {
parentPtr := bt.rootBlockPointer()
for _, pb := range parentBlocks {
dirtyPtrs = append(dirtyPtrs, parentPtr)
childInfo, _ := pb.childIPtr()
// Rem... | go | func (bt *blockTree) markParentsDirty(
ctx context.Context, parentBlocks []ParentBlockAndChildIndex) (
dirtyPtrs []BlockPointer, unrefs []BlockInfo, err error) {
parentPtr := bt.rootBlockPointer()
for _, pb := range parentBlocks {
dirtyPtrs = append(dirtyPtrs, parentPtr)
childInfo, _ := pb.childIPtr()
// Rem... | [
"func",
"(",
"bt",
"*",
"blockTree",
")",
"markParentsDirty",
"(",
"ctx",
"context",
".",
"Context",
",",
"parentBlocks",
"[",
"]",
"ParentBlockAndChildIndex",
")",
"(",
"dirtyPtrs",
"[",
"]",
"BlockPointer",
",",
"unrefs",
"[",
"]",
"BlockInfo",
",",
"err",... | // markParentsDirty caches all the blocks in `parentBlocks` as dirty,
// and returns the dirtied block pointers as well as any block infos
// with non-zero encoded sizes that will now need to be unreferenced. | [
"markParentsDirty",
"caches",
"all",
"the",
"blocks",
"in",
"parentBlocks",
"as",
"dirty",
"and",
"returns",
"the",
"dirtied",
"block",
"pointers",
"as",
"well",
"as",
"any",
"block",
"infos",
"with",
"non",
"-",
"zero",
"encoded",
"sizes",
"that",
"will",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/block_tree.go#L992-L1011 |
159,344 | keybase/client | go/kbfs/data/block_tree.go | readyHelper | func (bt *blockTree) readyHelper(
ctx context.Context, id tlf.ID, bcache BlockCache,
rp ReadyProvider, bps BlockPutState,
pathsFromRoot [][]ParentBlockAndChildIndex, makeSync makeSyncFunc) (
map[BlockInfo]BlockPointer, error) {
oldPtrs := make(map[BlockInfo]BlockPointer)
donePtrs := make(map[BlockPointer]bool)
... | go | func (bt *blockTree) readyHelper(
ctx context.Context, id tlf.ID, bcache BlockCache,
rp ReadyProvider, bps BlockPutState,
pathsFromRoot [][]ParentBlockAndChildIndex, makeSync makeSyncFunc) (
map[BlockInfo]BlockPointer, error) {
oldPtrs := make(map[BlockInfo]BlockPointer)
donePtrs := make(map[BlockPointer]bool)
... | [
"func",
"(",
"bt",
"*",
"blockTree",
")",
"readyHelper",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"tlf",
".",
"ID",
",",
"bcache",
"BlockCache",
",",
"rp",
"ReadyProvider",
",",
"bps",
"BlockPutState",
",",
"pathsFromRoot",
"[",
"]",
"[",
"]",
... | // readyHelper takes a set of paths from a root down to a child block,
// and readies all the blocks represented in those paths. If the
// caller wants leaf blocks readied, then the last element of each
// slice in `pathsFromRoot` should contain a leaf block, with a child
// index of -1. It's assumed that all slices ... | [
"readyHelper",
"takes",
"a",
"set",
"of",
"paths",
"from",
"a",
"root",
"down",
"to",
"a",
"child",
"block",
"and",
"readies",
"all",
"the",
"blocks",
"represented",
"in",
"those",
"paths",
".",
"If",
"the",
"caller",
"wants",
"leaf",
"blocks",
"readied",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/block_tree.go#L1081-L1131 |
159,345 | keybase/client | go/kbfs/data/block_tree.go | ready | func (bt *blockTree) ready(
ctx context.Context, id tlf.ID, bcache BlockCache,
dirtyBcache IsDirtyProvider, rp ReadyProvider, bps BlockPutState,
topBlock BlockWithPtrs, makeSync makeSyncFunc) (
map[BlockInfo]BlockPointer, error) {
if !topBlock.IsIndirect() {
return nil, nil
}
// This will contain paths to all... | go | func (bt *blockTree) ready(
ctx context.Context, id tlf.ID, bcache BlockCache,
dirtyBcache IsDirtyProvider, rp ReadyProvider, bps BlockPutState,
topBlock BlockWithPtrs, makeSync makeSyncFunc) (
map[BlockInfo]BlockPointer, error) {
if !topBlock.IsIndirect() {
return nil, nil
}
// This will contain paths to all... | [
"func",
"(",
"bt",
"*",
"blockTree",
")",
"ready",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"tlf",
".",
"ID",
",",
"bcache",
"BlockCache",
",",
"dirtyBcache",
"IsDirtyProvider",
",",
"rp",
"ReadyProvider",
",",
"bps",
"BlockPutState",
",",
"topBlo... | // ready, if given an indirect top-block, readies all the dirty child
// blocks, and updates their block IDs in their parent block's list of
// indirect pointers. It returns a map pointing from the new block
// info from any readied block to its corresponding old block pointer. | [
"ready",
"if",
"given",
"an",
"indirect",
"top",
"-",
"block",
"readies",
"all",
"the",
"dirty",
"child",
"blocks",
"and",
"updates",
"their",
"block",
"IDs",
"in",
"their",
"parent",
"block",
"s",
"list",
"of",
"indirect",
"pointers",
".",
"It",
"returns"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/block_tree.go#L1137-L1189 |
159,346 | keybase/client | go/kbfs/libkbfs/rekey_fsm.go | NewRekeyRequestWithPaperPromptEvent | func NewRekeyRequestWithPaperPromptEvent() RekeyEvent {
e := NewRekeyRequestEvent()
d := rekeyWithPromptWaitTimeDefault
e.request.promptPaper = true
e.request.timeout = &d
return e
} | go | func NewRekeyRequestWithPaperPromptEvent() RekeyEvent {
e := NewRekeyRequestEvent()
d := rekeyWithPromptWaitTimeDefault
e.request.promptPaper = true
e.request.timeout = &d
return e
} | [
"func",
"NewRekeyRequestWithPaperPromptEvent",
"(",
")",
"RekeyEvent",
"{",
"e",
":=",
"NewRekeyRequestEvent",
"(",
")",
"\n",
"d",
":=",
"rekeyWithPromptWaitTimeDefault",
"\n",
"e",
".",
"request",
".",
"promptPaper",
"=",
"true",
"\n",
"e",
".",
"request",
"."... | // NewRekeyRequestWithPaperPromptEvent creates a non-delayed rekey request
// Event that causes a paper prompt. | [
"NewRekeyRequestWithPaperPromptEvent",
"creates",
"a",
"non",
"-",
"delayed",
"rekey",
"request",
"Event",
"that",
"causes",
"a",
"paper",
"prompt",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/rekey_fsm.go#L158-L164 |
159,347 | keybase/client | go/kbfs/libkbfs/rekey_fsm.go | NewRekeyFSM | func NewRekeyFSM(fbo *folderBranchOps) RekeyFSM {
fsm := &rekeyFSM{
reqs: make(chan RekeyEvent, fbo.config.Mode().RekeyQueueSize()),
shutdownCh: make(chan struct{}),
fbo: fbo,
log: fbo.config.MakeLogger("RekeyFSM"),
listeners: make(map[rekeyEventType][]rekeyFSMListener),
}
fsm.current ... | go | func NewRekeyFSM(fbo *folderBranchOps) RekeyFSM {
fsm := &rekeyFSM{
reqs: make(chan RekeyEvent, fbo.config.Mode().RekeyQueueSize()),
shutdownCh: make(chan struct{}),
fbo: fbo,
log: fbo.config.MakeLogger("RekeyFSM"),
listeners: make(map[rekeyEventType][]rekeyFSMListener),
}
fsm.current ... | [
"func",
"NewRekeyFSM",
"(",
"fbo",
"*",
"folderBranchOps",
")",
"RekeyFSM",
"{",
"fsm",
":=",
"&",
"rekeyFSM",
"{",
"reqs",
":",
"make",
"(",
"chan",
"RekeyEvent",
",",
"fbo",
".",
"config",
".",
"Mode",
"(",
")",
".",
"RekeyQueueSize",
"(",
")",
")",
... | // NewRekeyFSM creates a new rekey FSM. | [
"NewRekeyFSM",
"creates",
"a",
"new",
"rekey",
"FSM",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/rekey_fsm.go#L457-L471 |
159,348 | keybase/client | go/kbfs/libkbfs/rekey_fsm.go | Event | func (m *rekeyFSM) Event(event RekeyEvent) {
select {
case m.reqs <- event:
case <-m.shutdownCh:
}
} | go | func (m *rekeyFSM) Event(event RekeyEvent) {
select {
case m.reqs <- event:
case <-m.shutdownCh:
}
} | [
"func",
"(",
"m",
"*",
"rekeyFSM",
")",
"Event",
"(",
"event",
"RekeyEvent",
")",
"{",
"select",
"{",
"case",
"m",
".",
"reqs",
"<-",
"event",
":",
"case",
"<-",
"m",
".",
"shutdownCh",
":",
"}",
"\n",
"}"
] | // Event implements RekeyFSM interface for rekeyFSM. | [
"Event",
"implements",
"RekeyFSM",
"interface",
"for",
"rekeyFSM",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/rekey_fsm.go#L502-L507 |
159,349 | keybase/client | go/kbfs/libkbfs/rekey_fsm.go | listenOnEvent | func (m *rekeyFSM) listenOnEvent(
event rekeyEventType, callback func(RekeyEvent), repeatedly bool) {
m.muListeners.Lock()
defer m.muListeners.Unlock()
m.listeners[event] = append(m.listeners[event], rekeyFSMListener{
onEvent: callback,
repeatedly: repeatedly,
})
} | go | func (m *rekeyFSM) listenOnEvent(
event rekeyEventType, callback func(RekeyEvent), repeatedly bool) {
m.muListeners.Lock()
defer m.muListeners.Unlock()
m.listeners[event] = append(m.listeners[event], rekeyFSMListener{
onEvent: callback,
repeatedly: repeatedly,
})
} | [
"func",
"(",
"m",
"*",
"rekeyFSM",
")",
"listenOnEvent",
"(",
"event",
"rekeyEventType",
",",
"callback",
"func",
"(",
"RekeyEvent",
")",
",",
"repeatedly",
"bool",
")",
"{",
"m",
".",
"muListeners",
".",
"Lock",
"(",
")",
"\n",
"defer",
"m",
".",
"muL... | // listenOnEvent implements RekeyFSM interface for rekeyFSM. | [
"listenOnEvent",
"implements",
"RekeyFSM",
"interface",
"for",
"rekeyFSM",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/rekey_fsm.go#L534-L542 |
159,350 | keybase/client | go/kbfs/libkbfs/rekey_fsm.go | RequestRekeyAndWaitForOneFinishEvent | func RequestRekeyAndWaitForOneFinishEvent(ctx context.Context,
ops KBFSOps, tlfID tlf.ID) (res RekeyResult, err error) {
fsm := getRekeyFSM(ctx, ops, tlfID)
rekeyWaiter := make(chan struct{})
fsm.listenOnEvent(rekeyFinishedEvent, func(e RekeyEvent) {
res = e.finished.RekeyResult
err = e.finished.err
close(rek... | go | func RequestRekeyAndWaitForOneFinishEvent(ctx context.Context,
ops KBFSOps, tlfID tlf.ID) (res RekeyResult, err error) {
fsm := getRekeyFSM(ctx, ops, tlfID)
rekeyWaiter := make(chan struct{})
fsm.listenOnEvent(rekeyFinishedEvent, func(e RekeyEvent) {
res = e.finished.RekeyResult
err = e.finished.err
close(rek... | [
"func",
"RequestRekeyAndWaitForOneFinishEvent",
"(",
"ctx",
"context",
".",
"Context",
",",
"ops",
"KBFSOps",
",",
"tlfID",
"tlf",
".",
"ID",
")",
"(",
"res",
"RekeyResult",
",",
"err",
"error",
")",
"{",
"fsm",
":=",
"getRekeyFSM",
"(",
"ctx",
",",
"ops",... | // RequestRekeyAndWaitForOneFinishEvent sends a rekey request to the FSM
// associated with tlfID, and wait for exact one rekeyFinished event. This can
// be useful for waiting for a rekey result in tests.
//
// Note that the supplied ctx is injected to the rekey task, so canceling ctx
// would actually cancel the reke... | [
"RequestRekeyAndWaitForOneFinishEvent",
"sends",
"a",
"rekey",
"request",
"to",
"the",
"FSM",
"associated",
"with",
"tlfID",
"and",
"wait",
"for",
"exact",
"one",
"rekeyFinished",
"event",
".",
"This",
"can",
"be",
"useful",
"for",
"waiting",
"for",
"a",
"rekey"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/rekey_fsm.go#L566-L578 |
159,351 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerError) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerError
s.Name = "SERVER_ERROR"
s.Desc = e.Error()
return
} | go | func (e ServerError) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerError
s.Name = "SERVER_ERROR"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerError",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerError",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e",
".",
"Error",
"(... | // ToStatus implements the ExportableError interface for ServerError. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerError",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L83-L88 |
159,352 | keybase/client | go/kbfs/kbfsmd/server_errors.go | Error | func (e ServerError) Error() string {
if e.Err != nil {
return e.Err.Error()
}
return "ServerError"
} | go | func (e ServerError) Error() string {
if e.Err != nil {
return e.Err.Error()
}
return "ServerError"
} | [
"func",
"(",
"e",
"ServerError",
")",
"Error",
"(",
")",
"string",
"{",
"if",
"e",
".",
"Err",
"!=",
"nil",
"{",
"return",
"e",
".",
"Err",
".",
"Error",
"(",
")",
"\n",
"}",
"\n",
"return",
"\"",
"\"",
"\n",
"}"
] | // Error implements the Error interface for ServerError. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerError",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L91-L96 |
159,353 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorBadRequest) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBadRequest
s.Name = "BAD_REQUEST"
s.Desc = e.Reason
return
} | go | func (e ServerErrorBadRequest) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBadRequest
s.Name = "BAD_REQUEST"
s.Desc = e.Reason
return
} | [
"func",
"(",
"e",
"ServerErrorBadRequest",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorBadRequest",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e",
... | // ToStatus implements the ExportableError interface for ServerErrorBadRequest. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorBadRequest",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L104-L109 |
159,354 | keybase/client | go/kbfs/kbfsmd/server_errors.go | Error | func (e ServerErrorConflictRevision) Error() string {
if e.Desc == "" {
return fmt.Sprintf("Conflict: expected revision %d, actual %d", e.Expected, e.Actual)
}
return "MDServerConflictRevision{" + e.Desc + "}"
} | go | func (e ServerErrorConflictRevision) Error() string {
if e.Desc == "" {
return fmt.Sprintf("Conflict: expected revision %d, actual %d", e.Expected, e.Actual)
}
return "MDServerConflictRevision{" + e.Desc + "}"
} | [
"func",
"(",
"e",
"ServerErrorConflictRevision",
")",
"Error",
"(",
")",
"string",
"{",
"if",
"e",
".",
"Desc",
"==",
"\"",
"\"",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Expected",
",",
"e",
".",
"Actual",
")",
"\n",
... | // Error implements the Error interface for ServerErrorConflictRevision. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerErrorConflictRevision",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L124-L129 |
159,355 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorConflictRevision) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictRevision
s.Name = "CONFLICT_REVISION"
s.Desc = e.Error()
return
} | go | func (e ServerErrorConflictRevision) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictRevision
s.Name = "CONFLICT_REVISION"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorConflictRevision",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorConflictRevision",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=... | // ToStatus implements the ExportableError interface for ServerErrorConflictRevision. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorConflictRevision",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L132-L137 |
159,356 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorConflictPrevRoot) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictPrevRoot
s.Name = "CONFLICT_PREV_ROOT"
s.Desc = e.Error()
return
} | go | func (e ServerErrorConflictPrevRoot) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictPrevRoot
s.Name = "CONFLICT_PREV_ROOT"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorConflictPrevRoot",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorConflictPrevRoot",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=... | // ToStatus implements the ExportableError interface for ServerErrorConflictPrevRoot. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorConflictPrevRoot",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L155-L160 |
159,357 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorConflictDiskUsage) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictDiskUsage
s.Name = "CONFLICT_DISK_USAGE"
s.Desc = e.Error()
return
} | go | func (e ServerErrorConflictDiskUsage) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConflictDiskUsage
s.Name = "CONFLICT_DISK_USAGE"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorConflictDiskUsage",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorConflictDiskUsage",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
... | // ToStatus implements the ExportableError interface for ServerErrorConflictDiskUsage. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorConflictDiskUsage",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L170-L175 |
159,358 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorLocked) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorLocked
s.Name = "LOCKED"
s.Desc = e.Error()
return
} | go | func (e ServerErrorLocked) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorLocked
s.Name = "LOCKED"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorLocked",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorLocked",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e",
".",
"... | // ToStatus implements the ExportableError interface for ServerErrorLocked. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorLocked",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L195-L200 |
159,359 | keybase/client | go/kbfs/kbfsmd/server_errors.go | Error | func (e ServerErrorUnauthorized) Error() string {
msg := "MDServer Unauthorized"
if e.Err != nil {
msg += ": " + e.Err.Error()
}
return msg
} | go | func (e ServerErrorUnauthorized) Error() string {
msg := "MDServer Unauthorized"
if e.Err != nil {
msg += ": " + e.Err.Error()
}
return msg
} | [
"func",
"(",
"e",
"ServerErrorUnauthorized",
")",
"Error",
"(",
")",
"string",
"{",
"msg",
":=",
"\"",
"\"",
"\n",
"if",
"e",
".",
"Err",
"!=",
"nil",
"{",
"msg",
"+=",
"\"",
"\"",
"+",
"e",
".",
"Err",
".",
"Error",
"(",
")",
"\n",
"}",
"\n",
... | // Error implements the Error interface for ServerErrorUnauthorized. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerErrorUnauthorized",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L208-L214 |
159,360 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorWriteAccess) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorWriteAccess
s.Name = "WRITE_ACCESS"
s.Desc = e.Error()
return
} | go | func (e ServerErrorWriteAccess) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorWriteAccess
s.Name = "WRITE_ACCESS"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorWriteAccess",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorWriteAccess",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e",
... | // ToStatus implements the ExportableError interface for ServerErrorWriteAccess. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorWriteAccess",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L234-L239 |
159,361 | keybase/client | go/kbfs/kbfsmd/server_errors.go | Error | func (e ServerErrorThrottle) Error() string {
if e.SuggestedRetryIn == nil {
return fmt.Sprintf("ServerErrorThrottle{%s}", e.Err.Error())
}
return fmt.Sprintf("ServerErrorThrottle[%s]{%s}", *e.SuggestedRetryIn, e.Err.Error())
} | go | func (e ServerErrorThrottle) Error() string {
if e.SuggestedRetryIn == nil {
return fmt.Sprintf("ServerErrorThrottle{%s}", e.Err.Error())
}
return fmt.Sprintf("ServerErrorThrottle[%s]{%s}", *e.SuggestedRetryIn, e.Err.Error())
} | [
"func",
"(",
"e",
"ServerErrorThrottle",
")",
"Error",
"(",
")",
"string",
"{",
"if",
"e",
".",
"SuggestedRetryIn",
"==",
"nil",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Err",
".",
"Error",
"(",
")",
")",
"\n",
"}",
... | // Error implements the Error interface for ServerErrorThrottle. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerErrorThrottle",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L248-L253 |
159,362 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorConditionFailed) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConditionFailed
s.Name = "CONDITION_FAILED"
s.Desc = e.Err.Error()
s.Fields = []keybase1.StringKVPair{
keybase1.StringKVPair{
Key: "ShouldThrottle",
Value: strconv.FormatBool(e.ShouldThrottle),
},
}
retu... | go | func (e ServerErrorConditionFailed) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorConditionFailed
s.Name = "CONDITION_FAILED"
s.Desc = e.Err.Error()
s.Fields = []keybase1.StringKVPair{
keybase1.StringKVPair{
Key: "ShouldThrottle",
Value: strconv.FormatBool(e.ShouldThrottle),
},
}
retu... | [
"func",
"(",
"e",
"ServerErrorConditionFailed",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorConditionFailed",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",... | // ToStatus implements the ExportableError interface for ServerErrorConditionFailed. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorConditionFailed",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L282-L293 |
159,363 | keybase/client | go/kbfs/kbfsmd/server_errors.go | Error | func (e ServerErrorTooManyFoldersCreated) Error() string {
return fmt.Sprintf("Too many folders created. Created: %d, limit: %d",
e.Created, e.Limit)
} | go | func (e ServerErrorTooManyFoldersCreated) Error() string {
return fmt.Sprintf("Too many folders created. Created: %d, limit: %d",
e.Created, e.Limit)
} | [
"func",
"(",
"e",
"ServerErrorTooManyFoldersCreated",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Created",
",",
"e",
".",
"Limit",
")",
"\n",
"}"
] | // Error implements the Error interface for ServerErrorTooManyFoldersCreated. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerErrorTooManyFoldersCreated",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L328-L331 |
159,364 | keybase/client | go/kbfs/kbfsmd/server_errors.go | ToStatus | func (e ServerErrorCannotReadFinalizedTLF) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorCannotReadFinalizedTLF
s.Name = "CANNOT_READ_FINALIZED_TLF"
s.Desc = e.Error()
return
} | go | func (e ServerErrorCannotReadFinalizedTLF) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorCannotReadFinalizedTLF
s.Name = "CANNOT_READ_FINALIZED_TLF"
s.Desc = e.Error()
return
} | [
"func",
"(",
"e",
"ServerErrorCannotReadFinalizedTLF",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorCannotReadFinalizedTLF",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
... | // ToStatus implements the ExportableError interface for
// ServerErrorCannotReadFinalizedTLF. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorCannotReadFinalizedTLF",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsmd/server_errors.go#L357-L362 |
159,365 | keybase/client | go/engine/scankeys.go | NewScanKeys | func NewScanKeys(m libkb.MetaContext) (sk *ScanKeys, err error) {
sk = &ScanKeys{
keyOwners: make(map[uint64]*libkb.User),
MetaContextified: libkb.NewMetaContextified(m),
}
defer m.Trace("NewScanKeys", func() error { return err })()
var loggedIn bool
loggedIn, err = isLoggedInWithError(m)
if err != n... | go | func NewScanKeys(m libkb.MetaContext) (sk *ScanKeys, err error) {
sk = &ScanKeys{
keyOwners: make(map[uint64]*libkb.User),
MetaContextified: libkb.NewMetaContextified(m),
}
defer m.Trace("NewScanKeys", func() error { return err })()
var loggedIn bool
loggedIn, err = isLoggedInWithError(m)
if err != n... | [
"func",
"NewScanKeys",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"sk",
"*",
"ScanKeys",
",",
"err",
"error",
")",
"{",
"sk",
"=",
"&",
"ScanKeys",
"{",
"keyOwners",
":",
"make",
"(",
"map",
"[",
"uint64",
"]",
"*",
"libkb",
".",
"User",
")",... | // NewScanKeys creates a ScanKeys type. If there is a login
// session, it will load the pgp keys for that user. | [
"NewScanKeys",
"creates",
"a",
"ScanKeys",
"type",
".",
"If",
"there",
"is",
"a",
"login",
"session",
"it",
"will",
"load",
"the",
"pgp",
"keys",
"for",
"that",
"user",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L40-L77 |
159,366 | keybase/client | go/engine/scankeys.go | KeysById | func (s *ScanKeys) KeysById(id uint64, fp []byte) []openpgp.Key {
m := s.M()
primaries := s.unlockByID(m, id)
memres := primaries.KeysById(id, fp)
m.Debug("ScanKeys:KeysById(%016x) => %d keys match in memory", id, len(memres))
if len(memres) > 0 {
m.Debug("ScanKeys:KeysById(%016x) => owner == me (%s)", id, s.me.... | go | func (s *ScanKeys) KeysById(id uint64, fp []byte) []openpgp.Key {
m := s.M()
primaries := s.unlockByID(m, id)
memres := primaries.KeysById(id, fp)
m.Debug("ScanKeys:KeysById(%016x) => %d keys match in memory", id, len(memres))
if len(memres) > 0 {
m.Debug("ScanKeys:KeysById(%016x) => owner == me (%s)", id, s.me.... | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"KeysById",
"(",
"id",
"uint64",
",",
"fp",
"[",
"]",
"byte",
")",
"[",
"]",
"openpgp",
".",
"Key",
"{",
"m",
":=",
"s",
".",
"M",
"(",
")",
"\n",
"primaries",
":=",
"s",
".",
"unlockByID",
"(",
"m",
",... | // KeysById returns the set of keys that have the given key id.
// It is only called during decryption by openpgp. | [
"KeysById",
"returns",
"the",
"set",
"of",
"keys",
"that",
"have",
"the",
"given",
"key",
"id",
".",
"It",
"is",
"only",
"called",
"during",
"decryption",
"by",
"openpgp",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L100-L116 |
159,367 | keybase/client | go/engine/scankeys.go | DecryptionKeys | func (s *ScanKeys) DecryptionKeys() []openpgp.Key {
m := s.M()
m.Debug("ScanKeys#DecryptionKeys() => %d keys available", s.Count())
all := s.unlockAll(m)
return all.DecryptionKeys()
} | go | func (s *ScanKeys) DecryptionKeys() []openpgp.Key {
m := s.M()
m.Debug("ScanKeys#DecryptionKeys() => %d keys available", s.Count())
all := s.unlockAll(m)
return all.DecryptionKeys()
} | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"DecryptionKeys",
"(",
")",
"[",
"]",
"openpgp",
".",
"Key",
"{",
"m",
":=",
"s",
".",
"M",
"(",
")",
"\n",
"m",
".",
"Debug",
"(",
"\"",
"\"",
",",
"s",
".",
"Count",
"(",
")",
")",
"\n",
"all",
":="... | // DecryptionKeys returns all private keys that are valid for
// decryption. It is only used if there is no key id in the
// message. | [
"DecryptionKeys",
"returns",
"all",
"private",
"keys",
"that",
"are",
"valid",
"for",
"decryption",
".",
"It",
"is",
"only",
"used",
"if",
"there",
"is",
"no",
"key",
"id",
"in",
"the",
"message",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L162-L167 |
159,368 | keybase/client | go/engine/scankeys.go | KeyOwner | func (s *ScanKeys) KeyOwner(keyID uint64) *libkb.User {
s.Lock()
defer s.Unlock()
return s.keyOwners[keyID]
} | go | func (s *ScanKeys) KeyOwner(keyID uint64) *libkb.User {
s.Lock()
defer s.Unlock()
return s.keyOwners[keyID]
} | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"KeyOwner",
"(",
"keyID",
"uint64",
")",
"*",
"libkb",
".",
"User",
"{",
"s",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"Unlock",
"(",
")",
"\n\n",
"return",
"s",
".",
"keyOwners",
"[",
"keyID",
"]",
... | // KeyOwner returns the owner of the keys found by ScanKeys that were
// used in KeysById or KeysByIdUsage, indexed by keyID. | [
"KeyOwner",
"returns",
"the",
"owner",
"of",
"the",
"keys",
"found",
"by",
"ScanKeys",
"that",
"were",
"used",
"in",
"KeysById",
"or",
"KeysByIdUsage",
"indexed",
"by",
"keyID",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L171-L176 |
159,369 | keybase/client | go/engine/scankeys.go | coalesceBlocks | func (s *ScanKeys) coalesceBlocks(m libkb.MetaContext, ring *libkb.SKBKeyringFile, synced *libkb.SKB) (err error) {
defer m.Trace("ScanKeys#coalesceBlocks", func() error { return err })()
// We want keys in this order: first local keyring keys that are LKSec, and
// then server synced keys that are triplesec. In Sc... | go | func (s *ScanKeys) coalesceBlocks(m libkb.MetaContext, ring *libkb.SKBKeyringFile, synced *libkb.SKB) (err error) {
defer m.Trace("ScanKeys#coalesceBlocks", func() error { return err })()
// We want keys in this order: first local keyring keys that are LKSec, and
// then server synced keys that are triplesec. In Sc... | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"coalesceBlocks",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"ring",
"*",
"libkb",
".",
"SKBKeyringFile",
",",
"synced",
"*",
"libkb",
".",
"SKB",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"m",
".",
"Trace"... | // coalesceBlocks puts the synced pgp key block and all the pgp key
// blocks in ring into s.skbs. | [
"coalesceBlocks",
"puts",
"the",
"synced",
"pgp",
"key",
"block",
"and",
"all",
"the",
"pgp",
"key",
"blocks",
"in",
"ring",
"into",
"s",
".",
"skbs",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L198-L227 |
159,370 | keybase/client | go/engine/scankeys.go | scan | func (s *ScanKeys) scan(m libkb.MetaContext, id uint64) (openpgp.EntityList, error) {
// lookup the user on the api server by the key id.
username, uid, err := s.apiLookup(m, id)
if err != nil {
return nil, err
}
m.Debug("key id %016x => %s, %s", id, id, username, uid)
if len(username) == 0 || len(uid) == 0 {
... | go | func (s *ScanKeys) scan(m libkb.MetaContext, id uint64) (openpgp.EntityList, error) {
// lookup the user on the api server by the key id.
username, uid, err := s.apiLookup(m, id)
if err != nil {
return nil, err
}
m.Debug("key id %016x => %s, %s", id, id, username, uid)
if len(username) == 0 || len(uid) == 0 {
... | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"scan",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"id",
"uint64",
")",
"(",
"openpgp",
".",
"EntityList",
",",
"error",
")",
"{",
"// lookup the user on the api server by the key id.",
"username",
",",
"uid",
",",
"e... | // scan finds the user on the api server for the key id. Then it
// uses PGPKeyfinder to find the public pgp keys for the user. | [
"scan",
"finds",
"the",
"user",
"on",
"the",
"api",
"server",
"for",
"the",
"key",
"id",
".",
"Then",
"it",
"uses",
"PGPKeyfinder",
"to",
"find",
"the",
"public",
"pgp",
"keys",
"for",
"the",
"user",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L231-L266 |
159,371 | keybase/client | go/engine/scankeys.go | apiLookup | func (s *ScanKeys) apiLookup(m libkb.MetaContext, id uint64) (username string, uid keybase1.UID, err error) {
return libkb.PGPLookup(m, id)
} | go | func (s *ScanKeys) apiLookup(m libkb.MetaContext, id uint64) (username string, uid keybase1.UID, err error) {
return libkb.PGPLookup(m, id)
} | [
"func",
"(",
"s",
"*",
"ScanKeys",
")",
"apiLookup",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"id",
"uint64",
")",
"(",
"username",
"string",
",",
"uid",
"keybase1",
".",
"UID",
",",
"err",
"error",
")",
"{",
"return",
"libkb",
".",
"PGPLookup",
"... | // apiLookup gets the username and uid from the api server for the
// key id. | [
"apiLookup",
"gets",
"the",
"username",
"and",
"uid",
"from",
"the",
"api",
"server",
"for",
"the",
"key",
"id",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/scankeys.go#L270-L272 |
159,372 | keybase/client | go/client/cmd_device_add.go | NewCmdDeviceAdd | func NewCmdDeviceAdd(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "add",
Usage: "Authorize a new device",
Description: cmdDevAddDesc,
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdDeviceAdd{Contextified: libkb.NewContextified(g)}, "add", c)
... | go | func NewCmdDeviceAdd(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "add",
Usage: "Authorize a new device",
Description: cmdDevAddDesc,
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdDeviceAdd{Contextified: libkb.NewContextified(g)}, "add", c)
... | [
"func",
"NewCmdDeviceAdd",
"(",
"cl",
"*",
"libcmdline",
".",
"CommandLine",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
")",
"cli",
".",
"Command",
"{",
"return",
"cli",
".",
"Command",
"{",
"Name",
":",
"\"",
"\"",
",",
"Usage",
":",
"\"",
"\"",
... | // NewCmdDeviceAdd creates a new cli.Command. | [
"NewCmdDeviceAdd",
"creates",
"a",
"new",
"cli",
".",
"Command",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_device_add.go#L28-L37 |
159,373 | keybase/client | go/service/handler.go | GetPassphrase | func (u *SecretUI) GetPassphrase(pinentry keybase1.GUIEntryArg, terminal *keybase1.SecretEntryArg) (keybase1.GetPassphraseRes, error) {
u.G().Log.Debug("SecretUI:GetPassphrase, sessionID = %d", u.sessionID)
return u.cli.GetPassphrase(context.TODO(), keybase1.GetPassphraseArg{SessionID: u.sessionID, Pinentry: pinentry... | go | func (u *SecretUI) GetPassphrase(pinentry keybase1.GUIEntryArg, terminal *keybase1.SecretEntryArg) (keybase1.GetPassphraseRes, error) {
u.G().Log.Debug("SecretUI:GetPassphrase, sessionID = %d", u.sessionID)
return u.cli.GetPassphrase(context.TODO(), keybase1.GetPassphraseArg{SessionID: u.sessionID, Pinentry: pinentry... | [
"func",
"(",
"u",
"*",
"SecretUI",
")",
"GetPassphrase",
"(",
"pinentry",
"keybase1",
".",
"GUIEntryArg",
",",
"terminal",
"*",
"keybase1",
".",
"SecretEntryArg",
")",
"(",
"keybase1",
".",
"GetPassphraseRes",
",",
"error",
")",
"{",
"u",
".",
"G",
"(",
... | // GetPassphrase gets the current keybase passphrase from delegated pinentry. | [
"GetPassphrase",
"gets",
"the",
"current",
"keybase",
"passphrase",
"from",
"delegated",
"pinentry",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/handler.go#L72-L75 |
159,374 | keybase/client | go/service/handler.go | DelegateRekeyUI | func (r *RekeyUI) DelegateRekeyUI(ctx context.Context) (int, error) {
r.G().Log.Warning("service RekeyUI.DelegateRekeyUI() called to get session id after RekeyUI object created")
return r.cli.DelegateRekeyUI(ctx)
} | go | func (r *RekeyUI) DelegateRekeyUI(ctx context.Context) (int, error) {
r.G().Log.Warning("service RekeyUI.DelegateRekeyUI() called to get session id after RekeyUI object created")
return r.cli.DelegateRekeyUI(ctx)
} | [
"func",
"(",
"r",
"*",
"RekeyUI",
")",
"DelegateRekeyUI",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"int",
",",
"error",
")",
"{",
"r",
".",
"G",
"(",
")",
".",
"Log",
".",
"Warning",
"(",
"\"",
"\"",
")",
"\n",
"return",
"r",
".",
"cli"... | // DelegateRekeyUI shouldn't be called on this object since it
// should already have a sessionID. | [
"DelegateRekeyUI",
"shouldn",
"t",
"be",
"called",
"on",
"this",
"object",
"since",
"it",
"should",
"already",
"have",
"a",
"sessionID",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/handler.go#L162-L165 |
159,375 | keybase/client | go/kbfs/libkbfs/block_journal.go | getSingleContext | func (e blockJournalEntry) getSingleContext() (
kbfsblock.ID, kbfsblock.Context, error) {
switch e.Op {
case blockPutOp, addRefOp:
if len(e.Contexts) != 1 {
return kbfsblock.ID{}, kbfsblock.Context{}, errors.Errorf(
"Op %s doesn't have exactly one context: %v",
e.Op, e.Contexts)
}
for id, idContexts... | go | func (e blockJournalEntry) getSingleContext() (
kbfsblock.ID, kbfsblock.Context, error) {
switch e.Op {
case blockPutOp, addRefOp:
if len(e.Contexts) != 1 {
return kbfsblock.ID{}, kbfsblock.Context{}, errors.Errorf(
"Op %s doesn't have exactly one context: %v",
e.Op, e.Contexts)
}
for id, idContexts... | [
"func",
"(",
"e",
"blockJournalEntry",
")",
"getSingleContext",
"(",
")",
"(",
"kbfsblock",
".",
"ID",
",",
"kbfsblock",
".",
"Context",
",",
"error",
")",
"{",
"switch",
"e",
".",
"Op",
"{",
"case",
"blockPutOp",
",",
"addRefOp",
":",
"if",
"len",
"("... | // Get the single context stored in this entry. Only applicable to
// blockPutOp and addRefOp. | [
"Get",
"the",
"single",
"context",
"stored",
"in",
"this",
"entry",
".",
"Only",
"applicable",
"to",
"blockPutOp",
"and",
"addRefOp",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L143-L164 |
159,376 | keybase/client | go/kbfs/libkbfs/block_journal.go | makeBlockJournal | func makeBlockJournal(
ctx context.Context, codec kbfscodec.Codec, dir string,
log logger.Logger, vlog *libkb.VDebugLog) (*blockJournal, error) {
journalPath := blockJournalDir(dir)
deferLog := log.CloneWithAddedDepth(1)
j, err := makeDiskJournal(
codec, journalPath, reflect.TypeOf(blockJournalEntry{}))
if err ... | go | func makeBlockJournal(
ctx context.Context, codec kbfscodec.Codec, dir string,
log logger.Logger, vlog *libkb.VDebugLog) (*blockJournal, error) {
journalPath := blockJournalDir(dir)
deferLog := log.CloneWithAddedDepth(1)
j, err := makeDiskJournal(
codec, journalPath, reflect.TypeOf(blockJournalEntry{}))
if err ... | [
"func",
"makeBlockJournal",
"(",
"ctx",
"context",
".",
"Context",
",",
"codec",
"kbfscodec",
".",
"Codec",
",",
"dir",
"string",
",",
"log",
"logger",
".",
"Logger",
",",
"vlog",
"*",
"libkb",
".",
"VDebugLog",
")",
"(",
"*",
"blockJournal",
",",
"error... | // makeBlockJournal returns a new blockJournal for the given
// directory. Any existing journal entries are read. | [
"makeBlockJournal",
"returns",
"a",
"new",
"blockJournal",
"for",
"the",
"given",
"directory",
".",
"Any",
"existing",
"journal",
"entries",
"are",
"read",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L180-L219 |
159,377 | keybase/client | go/kbfs/libkbfs/block_journal.go | putBlockData | func (j *blockJournal) putBlockData(
ctx context.Context, id kbfsblock.ID, context kbfsblock.Context,
buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf) (
putData bool, err error) {
j.vlog.CLogf(
ctx, libkb.VLog1,
"Putting %d bytes of data for block %s with context %v",
len(buf), id, context)
defer f... | go | func (j *blockJournal) putBlockData(
ctx context.Context, id kbfsblock.ID, context kbfsblock.Context,
buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf) (
putData bool, err error) {
j.vlog.CLogf(
ctx, libkb.VLog1,
"Putting %d bytes of data for block %s with context %v",
len(buf), id, context)
defer f... | [
"func",
"(",
"j",
"*",
"blockJournal",
")",
"putBlockData",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"kbfsblock",
".",
"ID",
",",
"context",
"kbfsblock",
".",
"Context",
",",
"buf",
"[",
"]",
"byte",
",",
"serverHalf",
"kbfscrypto",
".",
"BlockC... | // putBlockData puts the given block data. If err is non-nil, putData will
// always be false. | [
"putBlockData",
"puts",
"the",
"given",
"block",
"data",
".",
"If",
"err",
"is",
"non",
"-",
"nil",
"putData",
"will",
"always",
"be",
"false",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L419-L441 |
159,378 | keybase/client | go/kbfs/libkbfs/block_journal.go | appendBlock | func (j *blockJournal) appendBlock(
ctx context.Context, id kbfsblock.ID, context kbfsblock.Context,
bufLenToAdd int64) error {
j.vlog.CLogf(ctx, libkb.VLog1, "Appending block %s to journal", id)
if bufLenToAdd > 0 {
var putFiles int64 = filesPerBlockMax
err := j.accumulateBlock(bufLenToAdd, putFiles)
if err... | go | func (j *blockJournal) appendBlock(
ctx context.Context, id kbfsblock.ID, context kbfsblock.Context,
bufLenToAdd int64) error {
j.vlog.CLogf(ctx, libkb.VLog1, "Appending block %s to journal", id)
if bufLenToAdd > 0 {
var putFiles int64 = filesPerBlockMax
err := j.accumulateBlock(bufLenToAdd, putFiles)
if err... | [
"func",
"(",
"j",
"*",
"blockJournal",
")",
"appendBlock",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"kbfsblock",
".",
"ID",
",",
"context",
"kbfsblock",
".",
"Context",
",",
"bufLenToAdd",
"int64",
")",
"error",
"{",
"j",
".",
"vlog",
".",
"CL... | // appendBlock appends an entry for the previously-put block to the
// journal, and records the size for the put block. | [
"appendBlock",
"appends",
"an",
"entry",
"for",
"the",
"previously",
"-",
"put",
"block",
"to",
"the",
"journal",
"and",
"records",
"the",
"size",
"for",
"the",
"put",
"block",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L445-L473 |
159,379 | keybase/client | go/kbfs/libkbfs/block_journal.go | removeReferences | func (j *blockJournal) removeReferences(
ctx context.Context, contexts kbfsblock.ContextMap) (
liveCounts map[kbfsblock.ID]int, err error) {
j.vlog.CLogf(ctx, libkb.VLog1, "Removing references for %v", contexts)
defer func() {
if err != nil {
j.deferLog.CDebugf(ctx,
"Removing references for %+v", contexts,... | go | func (j *blockJournal) removeReferences(
ctx context.Context, contexts kbfsblock.ContextMap) (
liveCounts map[kbfsblock.ID]int, err error) {
j.vlog.CLogf(ctx, libkb.VLog1, "Removing references for %v", contexts)
defer func() {
if err != nil {
j.deferLog.CDebugf(ctx,
"Removing references for %+v", contexts,... | [
"func",
"(",
"j",
"*",
"blockJournal",
")",
"removeReferences",
"(",
"ctx",
"context",
".",
"Context",
",",
"contexts",
"kbfsblock",
".",
"ContextMap",
")",
"(",
"liveCounts",
"map",
"[",
"kbfsblock",
".",
"ID",
"]",
"int",
",",
"err",
"error",
")",
"{",... | // removeReferences removes references for the given contexts from
// their respective IDs. | [
"removeReferences",
"removes",
"references",
"for",
"the",
"given",
"contexts",
"from",
"their",
"respective",
"IDs",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L543-L579 |
159,380 | keybase/client | go/kbfs/libkbfs/block_journal.go | flushNonBPSBlockJournalEntry | func flushNonBPSBlockJournalEntry(
ctx context.Context, log logger.Logger,
bserver BlockServer, tlfID tlf.ID, entry blockJournalEntry) error {
log.CDebugf(ctx, "Flushing other block op %v", entry)
switch entry.Op {
case removeRefsOp:
_, err := bserver.RemoveBlockReferences(
ctx, tlfID, entry.Contexts)
if e... | go | func flushNonBPSBlockJournalEntry(
ctx context.Context, log logger.Logger,
bserver BlockServer, tlfID tlf.ID, entry blockJournalEntry) error {
log.CDebugf(ctx, "Flushing other block op %v", entry)
switch entry.Op {
case removeRefsOp:
_, err := bserver.RemoveBlockReferences(
ctx, tlfID, entry.Contexts)
if e... | [
"func",
"flushNonBPSBlockJournalEntry",
"(",
"ctx",
"context",
".",
"Context",
",",
"log",
"logger",
".",
"Logger",
",",
"bserver",
"BlockServer",
",",
"tlfID",
"tlf",
".",
"ID",
",",
"entry",
"blockJournalEntry",
")",
"error",
"{",
"log",
".",
"CDebugf",
"(... | // flushNonBPSBlockJournalEntry flushes journal entries that can't be
// parallelized via a blockPutState. | [
"flushNonBPSBlockJournalEntry",
"flushes",
"journal",
"entries",
"that",
"can",
"t",
"be",
"parallelized",
"via",
"a",
"blockPutState",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L775-L809 |
159,381 | keybase/client | go/kbfs/libkbfs/block_journal.go | getDeferredGCRange | func (j *blockJournal) getDeferredGCRange() (
len int, earliest, latest journalOrdinal, err error) {
earliest, err = j.deferredGC.readEarliestOrdinal()
if ioutil.IsNotExist(err) {
return 0, 0, 0, nil
} else if err != nil {
return 0, 0, 0, err
}
latest, err = j.deferredGC.readLatestOrdinal()
if ioutil.IsNotE... | go | func (j *blockJournal) getDeferredGCRange() (
len int, earliest, latest journalOrdinal, err error) {
earliest, err = j.deferredGC.readEarliestOrdinal()
if ioutil.IsNotExist(err) {
return 0, 0, 0, nil
} else if err != nil {
return 0, 0, 0, err
}
latest, err = j.deferredGC.readLatestOrdinal()
if ioutil.IsNotE... | [
"func",
"(",
"j",
"*",
"blockJournal",
")",
"getDeferredGCRange",
"(",
")",
"(",
"len",
"int",
",",
"earliest",
",",
"latest",
"journalOrdinal",
",",
"err",
"error",
")",
"{",
"earliest",
",",
"err",
"=",
"j",
".",
"deferredGC",
".",
"readEarliestOrdinal",... | // getDeferredRange gets the earliest and latest revision of the
// deferred GC journal. If the returned length is 0, there's no need
// for further GC. | [
"getDeferredRange",
"gets",
"the",
"earliest",
"and",
"latest",
"revision",
"of",
"the",
"deferred",
"GC",
"journal",
".",
"If",
"the",
"returned",
"length",
"is",
"0",
"there",
"s",
"no",
"need",
"for",
"further",
"GC",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L1062-L1079 |
159,382 | keybase/client | go/kbfs/libkbfs/block_journal.go | clearDeferredGCRange | func (j *blockJournal) clearDeferredGCRange(
ctx context.Context, removedBytes, removedFiles int64,
earliest, latest journalOrdinal) (
clearedJournal bool, aggregateInfo blockAggregateInfo,
err error) {
for i := earliest; i <= latest; i++ {
_, err := j.deferredGC.removeEarliest()
if err != nil {
return fals... | go | func (j *blockJournal) clearDeferredGCRange(
ctx context.Context, removedBytes, removedFiles int64,
earliest, latest journalOrdinal) (
clearedJournal bool, aggregateInfo blockAggregateInfo,
err error) {
for i := earliest; i <= latest; i++ {
_, err := j.deferredGC.removeEarliest()
if err != nil {
return fals... | [
"func",
"(",
"j",
"*",
"blockJournal",
")",
"clearDeferredGCRange",
"(",
"ctx",
"context",
".",
"Context",
",",
"removedBytes",
",",
"removedFiles",
"int64",
",",
"earliest",
",",
"latest",
"journalOrdinal",
")",
"(",
"clearedJournal",
"bool",
",",
"aggregateInf... | // clearDeferredGCRange removes the given range from the deferred
// journal. If the journal goes completely empty, it then nukes the
// journal directories. | [
"clearDeferredGCRange",
"removes",
"the",
"given",
"range",
"from",
"the",
"deferred",
"journal",
".",
"If",
"the",
"journal",
"goes",
"completely",
"empty",
"it",
"then",
"nukes",
"the",
"journal",
"directories",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_journal.go#L1143-L1184 |
159,383 | keybase/client | go/protocol/keybase1/device.go | DeviceList | func (c DeviceClient) DeviceList(ctx context.Context, sessionID int) (res []Device, err error) {
__arg := DeviceListArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceList", []interface{}{__arg}, &res)
return
} | go | func (c DeviceClient) DeviceList(ctx context.Context, sessionID int) (res []Device, err error) {
__arg := DeviceListArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceList", []interface{}{__arg}, &res)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"DeviceList",
"(",
"ctx",
"context",
".",
"Context",
",",
"sessionID",
"int",
")",
"(",
"res",
"[",
"]",
"Device",
",",
"err",
"error",
")",
"{",
"__arg",
":=",
"DeviceListArg",
"{",
"SessionID",
":",
"sessionID",
... | // List devices for the user. | [
"List",
"devices",
"for",
"the",
"user",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L204-L208 |
159,384 | keybase/client | go/protocol/keybase1/device.go | DeviceHistoryList | func (c DeviceClient) DeviceHistoryList(ctx context.Context, sessionID int) (res []DeviceDetail, err error) {
__arg := DeviceHistoryListArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceHistoryList", []interface{}{__arg}, &res)
return
} | go | func (c DeviceClient) DeviceHistoryList(ctx context.Context, sessionID int) (res []DeviceDetail, err error) {
__arg := DeviceHistoryListArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceHistoryList", []interface{}{__arg}, &res)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"DeviceHistoryList",
"(",
"ctx",
"context",
".",
"Context",
",",
"sessionID",
"int",
")",
"(",
"res",
"[",
"]",
"DeviceDetail",
",",
"err",
"error",
")",
"{",
"__arg",
":=",
"DeviceHistoryListArg",
"{",
"SessionID",
"... | // List all devices with detailed history and status information. | [
"List",
"all",
"devices",
"with",
"detailed",
"history",
"and",
"status",
"information",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L211-L215 |
159,385 | keybase/client | go/protocol/keybase1/device.go | DeviceAdd | func (c DeviceClient) DeviceAdd(ctx context.Context, sessionID int) (err error) {
__arg := DeviceAddArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceAdd", []interface{}{__arg}, nil)
return
} | go | func (c DeviceClient) DeviceAdd(ctx context.Context, sessionID int) (err error) {
__arg := DeviceAddArg{SessionID: sessionID}
err = c.Cli.Call(ctx, "keybase.1.device.deviceAdd", []interface{}{__arg}, nil)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"DeviceAdd",
"(",
"ctx",
"context",
".",
"Context",
",",
"sessionID",
"int",
")",
"(",
"err",
"error",
")",
"{",
"__arg",
":=",
"DeviceAddArg",
"{",
"SessionID",
":",
"sessionID",
"}",
"\n",
"err",
"=",
"c",
".",
... | // Starts the process of adding a new device using an existing
// device. It is called on the existing device.
// This is for kex2. | [
"Starts",
"the",
"process",
"of",
"adding",
"a",
"new",
"device",
"using",
"an",
"existing",
"device",
".",
"It",
"is",
"called",
"on",
"the",
"existing",
"device",
".",
"This",
"is",
"for",
"kex2",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L220-L224 |
159,386 | keybase/client | go/protocol/keybase1/device.go | CheckDeviceNameFormat | func (c DeviceClient) CheckDeviceNameFormat(ctx context.Context, __arg CheckDeviceNameFormatArg) (res bool, err error) {
err = c.Cli.Call(ctx, "keybase.1.device.checkDeviceNameFormat", []interface{}{__arg}, &res)
return
} | go | func (c DeviceClient) CheckDeviceNameFormat(ctx context.Context, __arg CheckDeviceNameFormatArg) (res bool, err error) {
err = c.Cli.Call(ctx, "keybase.1.device.checkDeviceNameFormat", []interface{}{__arg}, &res)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"CheckDeviceNameFormat",
"(",
"ctx",
"context",
".",
"Context",
",",
"__arg",
"CheckDeviceNameFormatArg",
")",
"(",
"res",
"bool",
",",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"Call",
"(",
"ctx",... | // Checks the device name format. | [
"Checks",
"the",
"device",
"name",
"format",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L227-L230 |
159,387 | keybase/client | go/protocol/keybase1/device.go | DismissDeviceChangeNotifications | func (c DeviceClient) DismissDeviceChangeNotifications(ctx context.Context) (err error) {
err = c.Cli.Call(ctx, "keybase.1.device.dismissDeviceChangeNotifications", []interface{}{DismissDeviceChangeNotificationsArg{}}, nil)
return
} | go | func (c DeviceClient) DismissDeviceChangeNotifications(ctx context.Context) (err error) {
err = c.Cli.Call(ctx, "keybase.1.device.dismissDeviceChangeNotifications", []interface{}{DismissDeviceChangeNotificationsArg{}}, nil)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"DismissDeviceChangeNotifications",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"Call",
"(",
"ctx",
",",
"\"",
"\"",
",",
"[",
"]",
"interface",
"... | // Dismisses the notifications for a new or revoked device
// assuming this is not that device. | [
"Dismisses",
"the",
"notifications",
"for",
"a",
"new",
"or",
"revoked",
"device",
"assuming",
"this",
"is",
"not",
"that",
"device",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L234-L237 |
159,388 | keybase/client | go/protocol/keybase1/device.go | CheckDeviceNameForUser | func (c DeviceClient) CheckDeviceNameForUser(ctx context.Context, __arg CheckDeviceNameForUserArg) (err error) {
err = c.Cli.Call(ctx, "keybase.1.device.checkDeviceNameForUser", []interface{}{__arg}, nil)
return
} | go | func (c DeviceClient) CheckDeviceNameForUser(ctx context.Context, __arg CheckDeviceNameForUserArg) (err error) {
err = c.Cli.Call(ctx, "keybase.1.device.checkDeviceNameForUser", []interface{}{__arg}, nil)
return
} | [
"func",
"(",
"c",
"DeviceClient",
")",
"CheckDeviceNameForUser",
"(",
"ctx",
"context",
".",
"Context",
",",
"__arg",
"CheckDeviceNameForUserArg",
")",
"(",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"Call",
"(",
"ctx",
",",
"\"",
"\"",
... | // Checks a given device against all of user's past devices,
// including those that predate a reset. It will also check a device name
// for proper formatting. Return null error on success, and a non-null
// error otherwise. | [
"Checks",
"a",
"given",
"device",
"against",
"all",
"of",
"user",
"s",
"past",
"devices",
"including",
"those",
"that",
"predate",
"a",
"reset",
".",
"It",
"will",
"also",
"check",
"a",
"device",
"name",
"for",
"proper",
"formatting",
".",
"Return",
"null"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/device.go#L243-L246 |
159,389 | keybase/client | go/kbfs/libkbfs/readonly_node.go | Readonly | func (rn ReadonlyNode) Readonly(ctx context.Context) bool {
return ctx.Value(CtxReadWriteKey) == nil
} | go | func (rn ReadonlyNode) Readonly(ctx context.Context) bool {
return ctx.Value(CtxReadWriteKey) == nil
} | [
"func",
"(",
"rn",
"ReadonlyNode",
")",
"Readonly",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"return",
"ctx",
".",
"Value",
"(",
"CtxReadWriteKey",
")",
"==",
"nil",
"\n",
"}"
] | // Readonly implements the Node interface for ReadonlyNode. | [
"Readonly",
"implements",
"the",
"Node",
"interface",
"for",
"ReadonlyNode",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/readonly_node.go#L30-L32 |
159,390 | keybase/client | go/kbfs/libkbfs/readonly_node.go | WrapChild | func (rn ReadonlyNode) WrapChild(child Node) Node {
return &ReadonlyNode{rn.Node.WrapChild(child)}
} | go | func (rn ReadonlyNode) WrapChild(child Node) Node {
return &ReadonlyNode{rn.Node.WrapChild(child)}
} | [
"func",
"(",
"rn",
"ReadonlyNode",
")",
"WrapChild",
"(",
"child",
"Node",
")",
"Node",
"{",
"return",
"&",
"ReadonlyNode",
"{",
"rn",
".",
"Node",
".",
"WrapChild",
"(",
"child",
")",
"}",
"\n",
"}"
] | // WrapChild implements the Node interface for ReadonlyNode. | [
"WrapChild",
"implements",
"the",
"Node",
"interface",
"for",
"ReadonlyNode",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/readonly_node.go#L35-L37 |
159,391 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | NewDiskBlockCacheRemote | func NewDiskBlockCacheRemote(kbCtx Context, config diskBlockCacheRemoteConfig) (
*DiskBlockCacheRemote, error) {
conn, xp, _, err := kbCtx.GetKBFSSocket(true)
if err != nil {
return nil, err
}
cli := rpc.NewClient(xp, KBFSErrorUnwrapper{},
libkb.LogTagsFromContext)
client := kbgitkbfs.DiskBlockCacheClient{Cli... | go | func NewDiskBlockCacheRemote(kbCtx Context, config diskBlockCacheRemoteConfig) (
*DiskBlockCacheRemote, error) {
conn, xp, _, err := kbCtx.GetKBFSSocket(true)
if err != nil {
return nil, err
}
cli := rpc.NewClient(xp, KBFSErrorUnwrapper{},
libkb.LogTagsFromContext)
client := kbgitkbfs.DiskBlockCacheClient{Cli... | [
"func",
"NewDiskBlockCacheRemote",
"(",
"kbCtx",
"Context",
",",
"config",
"diskBlockCacheRemoteConfig",
")",
"(",
"*",
"DiskBlockCacheRemote",
",",
"error",
")",
"{",
"conn",
",",
"xp",
",",
"_",
",",
"err",
":=",
"kbCtx",
".",
"GetKBFSSocket",
"(",
"true",
... | // NewDiskBlockCacheRemote creates a new remote disk cache client. | [
"NewDiskBlockCacheRemote",
"creates",
"a",
"new",
"remote",
"disk",
"cache",
"client",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L50-L71 |
159,392 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | Get | func (dbcr *DiskBlockCacheRemote) Get(ctx context.Context, tlfID tlf.ID,
blockID kbfsblock.ID, _ DiskBlockCacheType) (buf []byte,
serverHalf kbfscrypto.BlockCryptKeyServerHalf,
prefetchStatus PrefetchStatus, err error) {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Get %s", blockID)
defer func() {
dbcr.log.Laz... | go | func (dbcr *DiskBlockCacheRemote) Get(ctx context.Context, tlfID tlf.ID,
blockID kbfsblock.ID, _ DiskBlockCacheType) (buf []byte,
serverHalf kbfscrypto.BlockCryptKeyServerHalf,
prefetchStatus PrefetchStatus, err error) {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Get %s", blockID)
defer func() {
dbcr.log.Laz... | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"Get",
"(",
"ctx",
"context",
".",
"Context",
",",
"tlfID",
"tlf",
".",
"ID",
",",
"blockID",
"kbfsblock",
".",
"ID",
",",
"_",
"DiskBlockCacheType",
")",
"(",
"buf",
"[",
"]",
"byte",
",",
"server... | // Get implements the DiskBlockCache interface for DiskBlockCacheRemote. | [
"Get",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L74-L98 |
159,393 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | GetPrefetchStatus | func (dbcr *DiskBlockCacheRemote) GetPrefetchStatus(
ctx context.Context, tlfID tlf.ID, blockID kbfsblock.ID,
cacheType DiskBlockCacheType) (
prefetchStatus PrefetchStatus, err error) {
if tmp, ok := dbcr.statuses.Get(blockID); ok {
prefetchStatus := tmp.(PrefetchStatus)
return prefetchStatus, nil
}
dbcr.log... | go | func (dbcr *DiskBlockCacheRemote) GetPrefetchStatus(
ctx context.Context, tlfID tlf.ID, blockID kbfsblock.ID,
cacheType DiskBlockCacheType) (
prefetchStatus PrefetchStatus, err error) {
if tmp, ok := dbcr.statuses.Get(blockID); ok {
prefetchStatus := tmp.(PrefetchStatus)
return prefetchStatus, nil
}
dbcr.log... | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"GetPrefetchStatus",
"(",
"ctx",
"context",
".",
"Context",
",",
"tlfID",
"tlf",
".",
"ID",
",",
"blockID",
"kbfsblock",
".",
"ID",
",",
"cacheType",
"DiskBlockCacheType",
")",
"(",
"prefetchStatus",
"Pref... | // GetPrefetchStatus implements the DiskBlockCache interface for
// DiskBlockCacheRemote. | [
"GetPrefetchStatus",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L102-L129 |
159,394 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | Put | func (dbcr *DiskBlockCacheRemote) Put(ctx context.Context, tlfID tlf.ID,
blockID kbfsblock.ID, buf []byte,
serverHalf kbfscrypto.BlockCryptKeyServerHalf,
_ DiskBlockCacheType) (err error) {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Put %s", blockID)
defer func() {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemo... | go | func (dbcr *DiskBlockCacheRemote) Put(ctx context.Context, tlfID tlf.ID,
blockID kbfsblock.ID, buf []byte,
serverHalf kbfscrypto.BlockCryptKeyServerHalf,
_ DiskBlockCacheType) (err error) {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Put %s", blockID)
defer func() {
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemo... | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"Put",
"(",
"ctx",
"context",
".",
"Context",
",",
"tlfID",
"tlf",
".",
"ID",
",",
"blockID",
"kbfsblock",
".",
"ID",
",",
"buf",
"[",
"]",
"byte",
",",
"serverHalf",
"kbfscrypto",
".",
"BlockCryptKe... | // Put implements the DiskBlockCache interface for DiskBlockCacheRemote. | [
"Put",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L132-L147 |
159,395 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | Delete | func (dbcr *DiskBlockCacheRemote) Delete(
ctx context.Context, blockIDs []kbfsblock.ID,
cacheType DiskBlockCacheType) (
numRemoved int, sizeRemoved int64, err error) {
numBlocks := len(blockIDs)
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Delete %s block(s)",
numBlocks)
defer func() {
dbcr.log.LazyTrace(ct... | go | func (dbcr *DiskBlockCacheRemote) Delete(
ctx context.Context, blockIDs []kbfsblock.ID,
cacheType DiskBlockCacheType) (
numRemoved int, sizeRemoved int64, err error) {
numBlocks := len(blockIDs)
dbcr.log.LazyTrace(ctx, "DiskBlockCacheRemote: Delete %s block(s)",
numBlocks)
defer func() {
dbcr.log.LazyTrace(ct... | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"Delete",
"(",
"ctx",
"context",
".",
"Context",
",",
"blockIDs",
"[",
"]",
"kbfsblock",
".",
"ID",
",",
"cacheType",
"DiskBlockCacheType",
")",
"(",
"numRemoved",
"int",
",",
"sizeRemoved",
"int64",
","... | // Delete implements the DiskBlockCache interface for DiskBlockCacheRemote. | [
"Delete",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L150-L170 |
159,396 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | UpdateMetadata | func (dbcr *DiskBlockCacheRemote) UpdateMetadata(ctx context.Context,
tlfID tlf.ID, blockID kbfsblock.ID, prefetchStatus PrefetchStatus,
_ DiskBlockCacheType) error {
dbcr.statuses.Add(blockID, prefetchStatus)
return dbcr.client.UpdateBlockMetadata(ctx,
kbgitkbfs.UpdateBlockMetadataArg{
TlfID: tlfID.B... | go | func (dbcr *DiskBlockCacheRemote) UpdateMetadata(ctx context.Context,
tlfID tlf.ID, blockID kbfsblock.ID, prefetchStatus PrefetchStatus,
_ DiskBlockCacheType) error {
dbcr.statuses.Add(blockID, prefetchStatus)
return dbcr.client.UpdateBlockMetadata(ctx,
kbgitkbfs.UpdateBlockMetadataArg{
TlfID: tlfID.B... | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"UpdateMetadata",
"(",
"ctx",
"context",
".",
"Context",
",",
"tlfID",
"tlf",
".",
"ID",
",",
"blockID",
"kbfsblock",
".",
"ID",
",",
"prefetchStatus",
"PrefetchStatus",
",",
"_",
"DiskBlockCacheType",
")"... | // UpdateMetadata implements the DiskBlockCache interface for
// DiskBlockCacheRemote. | [
"UpdateMetadata",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L174-L184 |
159,397 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | GetLastUnrefRev | func (dbcr *DiskBlockCacheRemote) GetLastUnrefRev(
_ context.Context, _ tlf.ID, _ DiskBlockCacheType) (
kbfsmd.Revision, error) {
panic("GetLastUnrefRev() not implemented in DiskBlockCacheRemote")
} | go | func (dbcr *DiskBlockCacheRemote) GetLastUnrefRev(
_ context.Context, _ tlf.ID, _ DiskBlockCacheType) (
kbfsmd.Revision, error) {
panic("GetLastUnrefRev() not implemented in DiskBlockCacheRemote")
} | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"GetLastUnrefRev",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"tlf",
".",
"ID",
",",
"_",
"DiskBlockCacheType",
")",
"(",
"kbfsmd",
".",
"Revision",
",",
"error",
")",
"{",
"panic",
"(",
"\"",
... | // GetLastUnrefRev implements the DiskBlockCache interface for
// DiskBlockCacheRemote. | [
"GetLastUnrefRev",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L195-L199 |
159,398 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | DoesCacheHaveSpace | func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(
_ context.Context, _ DiskBlockCacheType) (bool, error) {
// We won't be kicking off long syncing prefetching via the remote
// cache, so just pretend the cache has space.
return true, nil
} | go | func (dbcr *DiskBlockCacheRemote) DoesCacheHaveSpace(
_ context.Context, _ DiskBlockCacheType) (bool, error) {
// We won't be kicking off long syncing prefetching via the remote
// cache, so just pretend the cache has space.
return true, nil
} | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"DoesCacheHaveSpace",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"DiskBlockCacheType",
")",
"(",
"bool",
",",
"error",
")",
"{",
"// We won't be kicking off long syncing prefetching via the remote",
"// cache, s... | // DoesCacheHaveSpace implements the DiskBlockCache interface for
// DiskBlockCacheRemote. | [
"DoesCacheHaveSpace",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L218-L223 |
159,399 | keybase/client | go/kbfs/libkbfs/disk_block_cache_remote.go | Mark | func (dbcr *DiskBlockCacheRemote) Mark(
_ context.Context, _ kbfsblock.ID, _ string, _ DiskBlockCacheType) error {
panic("Mark() not implemented in DiskBlockCacheRemote")
} | go | func (dbcr *DiskBlockCacheRemote) Mark(
_ context.Context, _ kbfsblock.ID, _ string, _ DiskBlockCacheType) error {
panic("Mark() not implemented in DiskBlockCacheRemote")
} | [
"func",
"(",
"dbcr",
"*",
"DiskBlockCacheRemote",
")",
"Mark",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"kbfsblock",
".",
"ID",
",",
"_",
"string",
",",
"_",
"DiskBlockCacheType",
")",
"error",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // Mark implements the DiskBlockCache interface for DiskBlockCacheRemote. | [
"Mark",
"implements",
"the",
"DiskBlockCache",
"interface",
"for",
"DiskBlockCacheRemote",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/disk_block_cache_remote.go#L226-L229 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.