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
160,700
keybase/client
go/chat/ephemeral_purger.go
loop
func (b *BackgroundEphemeralPurger) loop(shutdownCh chan struct{}) { bgctx := context.Background() b.Debug(bgctx, "loop: starting for %s", b.uid) for { select { case <-b.purgeTimer.C: b.Debug(bgctx, "loop: looping for %s", b.uid) b.queuePurges(bgctx) case <-shutdownCh: b.Debug(bgctx, "loop: shutting ...
go
func (b *BackgroundEphemeralPurger) loop(shutdownCh chan struct{}) { bgctx := context.Background() b.Debug(bgctx, "loop: starting for %s", b.uid) for { select { case <-b.purgeTimer.C: b.Debug(bgctx, "loop: looping for %s", b.uid) b.queuePurges(bgctx) case <-shutdownCh: b.Debug(bgctx, "loop: shutting ...
[ "func", "(", "b", "*", "BackgroundEphemeralPurger", ")", "loop", "(", "shutdownCh", "chan", "struct", "{", "}", ")", "{", "bgctx", ":=", "context", ".", "Background", "(", ")", "\n", "b", ".", "Debug", "(", "bgctx", ",", "\"", "\"", ",", "b", ".", ...
// This runs when we are waiting to run a job but will shut itself down if we // have no work.
[ "This", "runs", "when", "we", "are", "waiting", "to", "run", "a", "job", "but", "will", "shut", "itself", "down", "if", "we", "have", "no", "work", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/ephemeral_purger.go#L257-L271
160,701
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
currLocked
func (state *LockState) currLocked() *exclusionState { stateCount := len(state.exclusionStates) if stateCount == 0 { return nil } return &state.exclusionStates[stateCount-1] }
go
func (state *LockState) currLocked() *exclusionState { stateCount := len(state.exclusionStates) if stateCount == 0 { return nil } return &state.exclusionStates[stateCount-1] }
[ "func", "(", "state", "*", "LockState", ")", "currLocked", "(", ")", "*", "exclusionState", "{", "stateCount", ":=", "len", "(", "state", ".", "exclusionStates", ")", "\n", "if", "stateCount", "==", "0", "{", "return", "nil", "\n", "}", "\n", "return", ...
// currLocked returns the current exclusion state, or nil if there is // none.
[ "currLocked", "returns", "the", "current", "exclusion", "state", "or", "nil", "if", "there", "is", "none", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L112-L118
160,702
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
getExclusionType
func (state *LockState) getExclusionType(level MutexLevel) exclusionType { state.exclusionStatesLock.lock() defer state.exclusionStatesLock.unlock() // Not worth it to do anything more complicated than a // brute-force search. for _, state := range state.exclusionStates { if state.level > level { break } ...
go
func (state *LockState) getExclusionType(level MutexLevel) exclusionType { state.exclusionStatesLock.lock() defer state.exclusionStatesLock.unlock() // Not worth it to do anything more complicated than a // brute-force search. for _, state := range state.exclusionStates { if state.level > level { break } ...
[ "func", "(", "state", "*", "LockState", ")", "getExclusionType", "(", "level", "MutexLevel", ")", "exclusionType", "{", "state", ".", "exclusionStatesLock", ".", "lock", "(", ")", "\n", "defer", "state", ".", "exclusionStatesLock", ".", "unlock", "(", ")", "...
// getExclusionType returns returns the exclusionType for the given // MutexLevel, or nonExclusion if there is none.
[ "getExclusionType", "returns", "returns", "the", "exclusionType", "for", "the", "given", "MutexLevel", "or", "nonExclusion", "if", "there", "is", "none", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L215-L231
160,703
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
MakeLeveledMutex
func MakeLeveledMutex(level MutexLevel, locker sync.Locker) LeveledMutex { return LeveledMutex{ level: level, locker: locker, } }
go
func MakeLeveledMutex(level MutexLevel, locker sync.Locker) LeveledMutex { return LeveledMutex{ level: level, locker: locker, } }
[ "func", "MakeLeveledMutex", "(", "level", "MutexLevel", ",", "locker", "sync", ".", "Locker", ")", "LeveledMutex", "{", "return", "LeveledMutex", "{", "level", ":", "level", ",", "locker", ":", "locker", ",", "}", "\n", "}" ]
// MakeLeveledMutex makes a mutex with the given level, backed by the // given locker.
[ "MakeLeveledMutex", "makes", "a", "mutex", "with", "the", "given", "level", "backed", "by", "the", "given", "locker", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L243-L248
160,704
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
Unlock
func (m LeveledMutex) Unlock(lockState *LockState) { err := lockState.doUnlock(m.level, writeExclusion, m.locker) if err != nil { panic(err) } }
go
func (m LeveledMutex) Unlock(lockState *LockState) { err := lockState.doUnlock(m.level, writeExclusion, m.locker) if err != nil { panic(err) } }
[ "func", "(", "m", "LeveledMutex", ")", "Unlock", "(", "lockState", "*", "LockState", ")", "{", "err", ":=", "lockState", ".", "doUnlock", "(", "m", ".", "level", ",", "writeExclusion", ",", "m", ".", "locker", ")", "\n", "if", "err", "!=", "nil", "{"...
// Unlock locks the associated locker.
[ "Unlock", "locks", "the", "associated", "locker", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L259-L264
160,705
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
MakeLeveledRWMutex
func MakeLeveledRWMutex(level MutexLevel, rwLocker rwLocker) LeveledRWMutex { return LeveledRWMutex{ level: level, rwLocker: rwLocker, } }
go
func MakeLeveledRWMutex(level MutexLevel, rwLocker rwLocker) LeveledRWMutex { return LeveledRWMutex{ level: level, rwLocker: rwLocker, } }
[ "func", "MakeLeveledRWMutex", "(", "level", "MutexLevel", ",", "rwLocker", "rwLocker", ")", "LeveledRWMutex", "{", "return", "LeveledRWMutex", "{", "level", ":", "level", ",", "rwLocker", ":", "rwLocker", ",", "}", "\n", "}" ]
// MakeLeveledRWMutex makes a reader-writer mutex with the given // level, backed by the given rwLocker.
[ "MakeLeveledRWMutex", "makes", "a", "reader", "-", "writer", "mutex", "with", "the", "given", "level", "backed", "by", "the", "given", "rwLocker", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L336-L341
160,706
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
Unlock
func (rw LeveledRWMutex) Unlock(lockState *LockState) { err := lockState.doUnlock(rw.level, writeExclusion, rw.rwLocker) if err != nil { panic(err) } }
go
func (rw LeveledRWMutex) Unlock(lockState *LockState) { err := lockState.doUnlock(rw.level, writeExclusion, rw.rwLocker) if err != nil { panic(err) } }
[ "func", "(", "rw", "LeveledRWMutex", ")", "Unlock", "(", "lockState", "*", "LockState", ")", "{", "err", ":=", "lockState", ".", "doUnlock", "(", "rw", ".", "level", ",", "writeExclusion", ",", "rw", ".", "rwLocker", ")", "\n", "if", "err", "!=", "nil"...
// Unlock unlocks the associated locker.
[ "Unlock", "unlocks", "the", "associated", "locker", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L352-L357
160,707
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
RLock
func (rw LeveledRWMutex) RLock(lockState *LockState) { err := lockState.doLock(rw.level, readExclusion, rw.rwLocker.RLocker()) if err != nil { panic(err) } }
go
func (rw LeveledRWMutex) RLock(lockState *LockState) { err := lockState.doLock(rw.level, readExclusion, rw.rwLocker.RLocker()) if err != nil { panic(err) } }
[ "func", "(", "rw", "LeveledRWMutex", ")", "RLock", "(", "lockState", "*", "LockState", ")", "{", "err", ":=", "lockState", ".", "doLock", "(", "rw", ".", "level", ",", "readExclusion", ",", "rw", ".", "rwLocker", ".", "RLocker", "(", ")", ")", "\n", ...
// RLock locks the associated locker for reading.
[ "RLock", "locks", "the", "associated", "locker", "for", "reading", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L360-L365
160,708
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
RUnlock
func (rw LeveledRWMutex) RUnlock(lockState *LockState) { err := lockState.doUnlock(rw.level, readExclusion, rw.rwLocker.RLocker()) if err != nil { panic(err) } }
go
func (rw LeveledRWMutex) RUnlock(lockState *LockState) { err := lockState.doUnlock(rw.level, readExclusion, rw.rwLocker.RLocker()) if err != nil { panic(err) } }
[ "func", "(", "rw", "LeveledRWMutex", ")", "RUnlock", "(", "lockState", "*", "LockState", ")", "{", "err", ":=", "lockState", ".", "doUnlock", "(", "rw", ".", "level", ",", "readExclusion", ",", "rw", ".", "rwLocker", ".", "RLocker", "(", ")", ")", "\n"...
// RUnlock unlocks the associated locker for reading.
[ "RUnlock", "unlocks", "the", "associated", "locker", "for", "reading", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L368-L373
160,709
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
AssertRLocked
func (rw LeveledRWMutex) AssertRLocked(lockState *LockState) { et := lockState.getExclusionType(rw.level) if et != readExclusion { panic(unexpectedExclusionTypeError{ levelToString: lockState.levelToString, level: rw.level, expectedExclusionType: readExclusion, exclusionType: ...
go
func (rw LeveledRWMutex) AssertRLocked(lockState *LockState) { et := lockState.getExclusionType(rw.level) if et != readExclusion { panic(unexpectedExclusionTypeError{ levelToString: lockState.levelToString, level: rw.level, expectedExclusionType: readExclusion, exclusionType: ...
[ "func", "(", "rw", "LeveledRWMutex", ")", "AssertRLocked", "(", "lockState", "*", "LockState", ")", "{", "et", ":=", "lockState", ".", "getExclusionType", "(", "rw", ".", "level", ")", "\n", "if", "et", "!=", "readExclusion", "{", "panic", "(", "unexpected...
// AssertRLocked does nothing if m is r-locked with respect to the // given LockState. Otherwise, it panics.
[ "AssertRLocked", "does", "nothing", "if", "m", "is", "r", "-", "locked", "with", "respect", "to", "the", "given", "LockState", ".", "Otherwise", "it", "panics", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L404-L414
160,710
keybase/client
go/kbfs/kbfssync/leveled_mutex.go
AssertAnyLocked
func (rw LeveledRWMutex) AssertAnyLocked(lockState *LockState) { et := lockState.getExclusionType(rw.level) if et == nonExclusion { panic(unexpectedNonExclusionError{ levelToString: lockState.levelToString, level: rw.level, }) } }
go
func (rw LeveledRWMutex) AssertAnyLocked(lockState *LockState) { et := lockState.getExclusionType(rw.level) if et == nonExclusion { panic(unexpectedNonExclusionError{ levelToString: lockState.levelToString, level: rw.level, }) } }
[ "func", "(", "rw", "LeveledRWMutex", ")", "AssertAnyLocked", "(", "lockState", "*", "LockState", ")", "{", "et", ":=", "lockState", ".", "getExclusionType", "(", "rw", ".", "level", ")", "\n", "if", "et", "==", "nonExclusion", "{", "panic", "(", "unexpecte...
// AssertAnyLocked does nothing if m is locked or r-locked with // respect to the given LockState. Otherwise, it panics.
[ "AssertAnyLocked", "does", "nothing", "if", "m", "is", "locked", "or", "r", "-", "locked", "with", "respect", "to", "the", "given", "LockState", ".", "Otherwise", "it", "panics", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/leveled_mutex.go#L427-L435
160,711
keybase/client
go/kbfs/data/file_data.go
NewFileData
func NewFileData( file Path, chargedTo keybase1.UserOrTeamID, bsplit BlockSplitter, kmd libkey.KeyMetadata, getter FileBlockGetter, cacher dirtyBlockCacher, log logger.Logger, vlog *libkb.VDebugLog) *FileData { fd := &FileData{ getter: getter, } fd.tree = &blockTree{ file: file, chargedTo: chargedTo, ...
go
func NewFileData( file Path, chargedTo keybase1.UserOrTeamID, bsplit BlockSplitter, kmd libkey.KeyMetadata, getter FileBlockGetter, cacher dirtyBlockCacher, log logger.Logger, vlog *libkb.VDebugLog) *FileData { fd := &FileData{ getter: getter, } fd.tree = &blockTree{ file: file, chargedTo: chargedTo, ...
[ "func", "NewFileData", "(", "file", "Path", ",", "chargedTo", "keybase1", ".", "UserOrTeamID", ",", "bsplit", "BlockSplitter", ",", "kmd", "libkey", ".", "KeyMetadata", ",", "getter", "FileBlockGetter", ",", "cacher", "dirtyBlockCacher", ",", "log", "logger", "....
// NewFileData makes a new file data object for the given `file` // within the given `kmd`.
[ "NewFileData", "makes", "a", "new", "file", "data", "object", "for", "the", "given", "file", "within", "the", "given", "kmd", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L37-L56
160,712
keybase/client
go/kbfs/data/file_data.go
Read
func (fd *FileData) Read(ctx context.Context, dest []byte, startOff Int64Offset) (int64, error) { if len(dest) == 0 { return 0, nil } // If we have a large enough timeout add a temporary timeout that is // readTimeoutSmallerBy. Use that for reading so short reads get returned // upstream without triggering the...
go
func (fd *FileData) Read(ctx context.Context, dest []byte, startOff Int64Offset) (int64, error) { if len(dest) == 0 { return 0, nil } // If we have a large enough timeout add a temporary timeout that is // readTimeoutSmallerBy. Use that for reading so short reads get returned // upstream without triggering the...
[ "func", "(", "fd", "*", "FileData", ")", "Read", "(", "ctx", "context", ".", "Context", ",", "dest", "[", "]", "byte", ",", "startOff", "Int64Offset", ")", "(", "int64", ",", "error", ")", "{", "if", "len", "(", "dest", ")", "==", "0", "{", "retu...
// read fills the `dest` buffer with data from the file, starting at // `startOff`. Returns the number of bytes copied. If the read // operation nears the deadline set in `ctx`, it returns as big a // prefix as possible before reaching the deadline.
[ "read", "fills", "the", "dest", "buffer", "with", "data", "from", "the", "file", "starting", "at", "startOff", ".", "Returns", "the", "number", "of", "bytes", "copied", ".", "If", "the", "read", "operation", "nears", "the", "deadline", "set", "in", "ctx", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L251-L284
160,713
keybase/client
go/kbfs/data/file_data.go
GetBytes
func (fd *FileData) GetBytes(ctx context.Context, startOff, endOff Int64Offset) (data []byte, err error) { bytes, err := fd.getByteSlicesInOffsetRange(ctx, startOff, endOff, false) if err != nil { return nil, err } bufSize := 0 for _, b := range bytes { bufSize += len(b) } data = make([]byte, bufSize) cur...
go
func (fd *FileData) GetBytes(ctx context.Context, startOff, endOff Int64Offset) (data []byte, err error) { bytes, err := fd.getByteSlicesInOffsetRange(ctx, startOff, endOff, false) if err != nil { return nil, err } bufSize := 0 for _, b := range bytes { bufSize += len(b) } data = make([]byte, bufSize) cur...
[ "func", "(", "fd", "*", "FileData", ")", "GetBytes", "(", "ctx", "context", ".", "Context", ",", "startOff", ",", "endOff", "Int64Offset", ")", "(", "data", "[", "]", "byte", ",", "err", "error", ")", "{", "bytes", ",", "err", ":=", "fd", ".", "get...
// GetBytes returns a buffer containing data from the file, in the // half-inclusive range `[startOff, endOff)`. If `endOff` == -1, it // returns data until the end of the file.
[ "GetBytes", "returns", "a", "buffer", "containing", "data", "from", "the", "file", "in", "the", "half", "-", "inclusive", "range", "[", "startOff", "endOff", ")", ".", "If", "endOff", "==", "-", "1", "it", "returns", "data", "until", "the", "end", "of", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L289-L308
160,714
keybase/client
go/kbfs/data/file_data.go
GetFileBlockAtOffset
func (fd *FileData) GetFileBlockAtOffset(ctx context.Context, topBlock *FileBlock, off Int64Offset, rtype BlockReqType) ( ptr BlockPointer, parentBlocks []ParentBlockAndChildIndex, block *FileBlock, nextBlockStartOff, startOff Int64Offset, wasDirty bool, err error) { ptr, parentBlocks, b, nbso, so, wasDirty, err :...
go
func (fd *FileData) GetFileBlockAtOffset(ctx context.Context, topBlock *FileBlock, off Int64Offset, rtype BlockReqType) ( ptr BlockPointer, parentBlocks []ParentBlockAndChildIndex, block *FileBlock, nextBlockStartOff, startOff Int64Offset, wasDirty bool, err error) { ptr, parentBlocks, b, nbso, so, wasDirty, err :...
[ "func", "(", "fd", "*", "FileData", ")", "GetFileBlockAtOffset", "(", "ctx", "context", ".", "Context", ",", "topBlock", "*", "FileBlock", ",", "off", "Int64Offset", ",", "rtype", "BlockReqType", ")", "(", "ptr", "BlockPointer", ",", "parentBlocks", "[", "]"...
// GetFileBlockAtOffset returns the leaf file block responsible for // the given offset.
[ "GetFileBlockAtOffset", "returns", "the", "leaf", "file", "block", "responsible", "for", "the", "given", "offset", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L359-L381
160,715
keybase/client
go/kbfs/data/file_data.go
Ready
func (fd *FileData) Ready(ctx context.Context, id tlf.ID, bcache BlockCache, dirtyBcache IsDirtyProvider, rp ReadyProvider, bps BlockPutState, topBlock *FileBlock, df *DirtyFile) ( map[BlockInfo]BlockPointer, error) { return fd.tree.ready( ctx, id, bcache, dirtyBcache, rp, bps, topBlock, func(ptr BlockPointer) ...
go
func (fd *FileData) Ready(ctx context.Context, id tlf.ID, bcache BlockCache, dirtyBcache IsDirtyProvider, rp ReadyProvider, bps BlockPutState, topBlock *FileBlock, df *DirtyFile) ( map[BlockInfo]BlockPointer, error) { return fd.tree.ready( ctx, id, bcache, dirtyBcache, rp, bps, topBlock, func(ptr BlockPointer) ...
[ "func", "(", "fd", "*", "FileData", ")", "Ready", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "bcache", "BlockCache", ",", "dirtyBcache", "IsDirtyProvider", ",", "rp", "ReadyProvider", ",", "bps", "BlockPutState", ",", "topBloc...
// Ready readies, if given an indirect top-block, 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", "readies", "if", "given", "an", "indirect", "top", "-", "block", "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/file_data.go#L1005-L1017
160,716
keybase/client
go/kbfs/data/file_data.go
GetIndirectFileBlockInfosWithTopBlock
func (fd *FileData) GetIndirectFileBlockInfosWithTopBlock( ctx context.Context, topBlock *FileBlock) ([]BlockInfo, error) { return fd.tree.getIndirectBlockInfosWithTopBlock(ctx, topBlock) }
go
func (fd *FileData) GetIndirectFileBlockInfosWithTopBlock( ctx context.Context, topBlock *FileBlock) ([]BlockInfo, error) { return fd.tree.getIndirectBlockInfosWithTopBlock(ctx, topBlock) }
[ "func", "(", "fd", "*", "FileData", ")", "GetIndirectFileBlockInfosWithTopBlock", "(", "ctx", "context", ".", "Context", ",", "topBlock", "*", "FileBlock", ")", "(", "[", "]", "BlockInfo", ",", "error", ")", "{", "return", "fd", ".", "tree", ".", "getIndir...
// GetIndirectFileBlockInfosWithTopBlock returns the block infos // contained in all the indirect blocks in this file tree, given an // already-fetched top block.
[ "GetIndirectFileBlockInfosWithTopBlock", "returns", "the", "block", "infos", "contained", "in", "all", "the", "indirect", "blocks", "in", "this", "file", "tree", "given", "an", "already", "-", "fetched", "top", "block", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L1022-L1025
160,717
keybase/client
go/kbfs/data/file_data.go
GetIndirectFileBlockInfos
func (fd *FileData) GetIndirectFileBlockInfos(ctx context.Context) ( []BlockInfo, error) { return fd.tree.getIndirectBlockInfos(ctx) }
go
func (fd *FileData) GetIndirectFileBlockInfos(ctx context.Context) ( []BlockInfo, error) { return fd.tree.getIndirectBlockInfos(ctx) }
[ "func", "(", "fd", "*", "FileData", ")", "GetIndirectFileBlockInfos", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "BlockInfo", ",", "error", ")", "{", "return", "fd", ".", "tree", ".", "getIndirectBlockInfos", "(", "ctx", ")", "\n", "}" ]
// GetIndirectFileBlockInfos returns the block infos contained in all // the indirect blocks in this file tree.
[ "GetIndirectFileBlockInfos", "returns", "the", "block", "infos", "contained", "in", "all", "the", "indirect", "blocks", "in", "this", "file", "tree", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L1029-L1032
160,718
keybase/client
go/kbfs/data/file_data.go
FindIPtrsAndClearSize
func (fd *FileData) FindIPtrsAndClearSize( ctx context.Context, topBlock *FileBlock, ptrs map[BlockPointer]bool) ( found map[BlockPointer]bool, err error) { if !topBlock.IsInd || len(ptrs) == 0 { return nil, nil } pfr, err := fd.tree.getIndirectBlocksForOffsetRange( ctx, topBlock, Int64Offset(0), nil) if err...
go
func (fd *FileData) FindIPtrsAndClearSize( ctx context.Context, topBlock *FileBlock, ptrs map[BlockPointer]bool) ( found map[BlockPointer]bool, err error) { if !topBlock.IsInd || len(ptrs) == 0 { return nil, nil } pfr, err := fd.tree.getIndirectBlocksForOffsetRange( ctx, topBlock, Int64Offset(0), nil) if err...
[ "func", "(", "fd", "*", "FileData", ")", "FindIPtrsAndClearSize", "(", "ctx", "context", ".", "Context", ",", "topBlock", "*", "FileBlock", ",", "ptrs", "map", "[", "BlockPointer", "]", "bool", ")", "(", "found", "map", "[", "BlockPointer", "]", "bool", ...
// FindIPtrsAndClearSize looks for the given set of indirect pointers, // and returns whether they could be found. As a side effect, it also // clears the encoded size for those indirect pointers.
[ "FindIPtrsAndClearSize", "looks", "for", "the", "given", "set", "of", "indirect", "pointers", "and", "returns", "whether", "they", "could", "be", "found", ".", "As", "a", "side", "effect", "it", "also", "clears", "the", "encoded", "size", "for", "those", "in...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/file_data.go#L1037-L1103
160,719
keybase/client
go/kbfs/kbfssync/repeated_wait_group.go
Add
func (rwg *RepeatedWaitGroup) Add(delta int) { rwg.lock.Lock() defer rwg.lock.Unlock() if rwg.isIdleCh == nil { rwg.isIdleCh = make(chan struct{}) } if rwg.num+delta < 0 { panic("RepeatedWaitGroup count would be negative") } rwg.num += delta if rwg.num == 0 { close(rwg.isIdleCh) rwg.isIdleCh = nil } }
go
func (rwg *RepeatedWaitGroup) Add(delta int) { rwg.lock.Lock() defer rwg.lock.Unlock() if rwg.isIdleCh == nil { rwg.isIdleCh = make(chan struct{}) } if rwg.num+delta < 0 { panic("RepeatedWaitGroup count would be negative") } rwg.num += delta if rwg.num == 0 { close(rwg.isIdleCh) rwg.isIdleCh = nil } }
[ "func", "(", "rwg", "*", "RepeatedWaitGroup", ")", "Add", "(", "delta", "int", ")", "{", "rwg", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "rwg", ".", "lock", ".", "Unlock", "(", ")", "\n", "if", "rwg", ".", "isIdleCh", "==", "nil", "{", ...
// Add indicates that a number of tasks have begun.
[ "Add", "indicates", "that", "a", "number", "of", "tasks", "have", "begun", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/repeated_wait_group.go#L32-L46
160,720
keybase/client
go/kbfs/kbfssync/repeated_wait_group.go
Wait
func (rwg *RepeatedWaitGroup) Wait(ctx context.Context) error { isIdleCh := func() chan struct{} { rwg.lock.Lock() defer rwg.lock.Unlock() return rwg.isIdleCh }() if isIdleCh == nil { return nil } select { case <-isIdleCh: return nil case <-ctx.Done(): return ctx.Err() } }
go
func (rwg *RepeatedWaitGroup) Wait(ctx context.Context) error { isIdleCh := func() chan struct{} { rwg.lock.Lock() defer rwg.lock.Unlock() return rwg.isIdleCh }() if isIdleCh == nil { return nil } select { case <-isIdleCh: return nil case <-ctx.Done(): return ctx.Err() } }
[ "func", "(", "rwg", "*", "RepeatedWaitGroup", ")", "Wait", "(", "ctx", "context", ".", "Context", ")", "error", "{", "isIdleCh", ":=", "func", "(", ")", "chan", "struct", "{", "}", "{", "rwg", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "rwg...
// Wait blocks until either the underlying task count goes to 0, or // the given context is canceled.
[ "Wait", "blocks", "until", "either", "the", "underlying", "task", "count", "goes", "to", "0", "or", "the", "given", "context", "is", "canceled", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/repeated_wait_group.go#L50-L67
160,721
keybase/client
go/kbfs/kbfssync/repeated_wait_group.go
WaitUnlessPaused
func (rwg *RepeatedWaitGroup) WaitUnlessPaused(ctx context.Context) ( bool, error) { paused, isIdleCh, pauseCh := func() (bool, chan struct{}, chan struct{}) { rwg.lock.Lock() defer rwg.lock.Unlock() if !rwg.paused && rwg.pauseCh == nil { rwg.pauseCh = make(chan struct{}) } return rwg.paused, rwg.isIdleC...
go
func (rwg *RepeatedWaitGroup) WaitUnlessPaused(ctx context.Context) ( bool, error) { paused, isIdleCh, pauseCh := func() (bool, chan struct{}, chan struct{}) { rwg.lock.Lock() defer rwg.lock.Unlock() if !rwg.paused && rwg.pauseCh == nil { rwg.pauseCh = make(chan struct{}) } return rwg.paused, rwg.isIdleC...
[ "func", "(", "rwg", "*", "RepeatedWaitGroup", ")", "WaitUnlessPaused", "(", "ctx", "context", ".", "Context", ")", "(", "bool", ",", "error", ")", "{", "paused", ",", "isIdleCh", ",", "pauseCh", ":=", "func", "(", ")", "(", "bool", ",", "chan", "struct...
// WaitUnlessPaused works like Wait, except it can return early if the // wait group is paused. It returns whether it was paused with // outstanding work still left in the group.
[ "WaitUnlessPaused", "works", "like", "Wait", "except", "it", "can", "return", "early", "if", "the", "wait", "group", "is", "paused", ".", "It", "returns", "whether", "it", "was", "paused", "with", "outstanding", "work", "still", "left", "in", "the", "group",...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/repeated_wait_group.go#L72-L99
160,722
keybase/client
go/kbfs/kbfssync/repeated_wait_group.go
Pause
func (rwg *RepeatedWaitGroup) Pause() { rwg.lock.Lock() defer rwg.lock.Unlock() rwg.paused = true if rwg.pauseCh != nil { close(rwg.pauseCh) rwg.pauseCh = nil } }
go
func (rwg *RepeatedWaitGroup) Pause() { rwg.lock.Lock() defer rwg.lock.Unlock() rwg.paused = true if rwg.pauseCh != nil { close(rwg.pauseCh) rwg.pauseCh = nil } }
[ "func", "(", "rwg", "*", "RepeatedWaitGroup", ")", "Pause", "(", ")", "{", "rwg", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "rwg", ".", "lock", ".", "Unlock", "(", ")", "\n", "rwg", ".", "paused", "=", "true", "\n", "if", "rwg", ".", "...
// Pause causes any current or future callers of `WaitUnlessPaused` to // return immediately.
[ "Pause", "causes", "any", "current", "or", "future", "callers", "of", "WaitUnlessPaused", "to", "return", "immediately", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/repeated_wait_group.go#L103-L111
160,723
keybase/client
go/kbfs/kbfssync/repeated_wait_group.go
Resume
func (rwg *RepeatedWaitGroup) Resume() { rwg.lock.Lock() defer rwg.lock.Unlock() if rwg.pauseCh != nil { panic("Non-nil pauseCh on resume!") } rwg.paused = false }
go
func (rwg *RepeatedWaitGroup) Resume() { rwg.lock.Lock() defer rwg.lock.Unlock() if rwg.pauseCh != nil { panic("Non-nil pauseCh on resume!") } rwg.paused = false }
[ "func", "(", "rwg", "*", "RepeatedWaitGroup", ")", "Resume", "(", ")", "{", "rwg", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "rwg", ".", "lock", ".", "Unlock", "(", ")", "\n", "if", "rwg", ".", "pauseCh", "!=", "nil", "{", "panic", "(", ...
// Resume unpauses the wait group, allowing future callers of // `WaitUnlessPaused` to wait until all the outstanding work is // completed.
[ "Resume", "unpauses", "the", "wait", "group", "allowing", "future", "callers", "of", "WaitUnlessPaused", "to", "wait", "until", "all", "the", "outstanding", "work", "is", "completed", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfssync/repeated_wait_group.go#L116-L123
160,724
keybase/client
go/engine/template.go
NewTemplate
func NewTemplate(g *libkb.GlobalContext) *Template { return &Template{ Contextified: libkb.NewContextified(g), } }
go
func NewTemplate(g *libkb.GlobalContext) *Template { return &Template{ Contextified: libkb.NewContextified(g), } }
[ "func", "NewTemplate", "(", "g", "*", "libkb", ".", "GlobalContext", ")", "*", "Template", "{", "return", "&", "Template", "{", "Contextified", ":", "libkb", ".", "NewContextified", "(", "g", ")", ",", "}", "\n", "}" ]
// NewTemplate creates a Template engine.
[ "NewTemplate", "creates", "a", "Template", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/template.go#L23-L27
160,725
keybase/client
go/kbfs/kbfscrypto/pad.go
PadBlock
func PadBlock(block []byte) ([]byte, error) { totalLen := powerOfTwoEqualOrGreater(len(block)) buf := make([]byte, padPrefixSize+totalLen) binary.LittleEndian.PutUint32(buf, uint32(len(block))) copy(buf[padPrefixSize:], block) return buf, nil }
go
func PadBlock(block []byte) ([]byte, error) { totalLen := powerOfTwoEqualOrGreater(len(block)) buf := make([]byte, padPrefixSize+totalLen) binary.LittleEndian.PutUint32(buf, uint32(len(block))) copy(buf[padPrefixSize:], block) return buf, nil }
[ "func", "PadBlock", "(", "block", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "totalLen", ":=", "powerOfTwoEqualOrGreater", "(", "len", "(", "block", ")", ")", "\n\n", "buf", ":=", "make", "(", "[", "]", "byte", ",", "padP...
// PadBlock adds zero padding to an encoded block.
[ "PadBlock", "adds", "zero", "padding", "to", "an", "encoded", "block", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/pad.go#L44-L52
160,726
keybase/client
go/kbfs/kbfscrypto/pad.go
DepadBlock
func DepadBlock(paddedBlock []byte) ([]byte, error) { totalLen := len(paddedBlock) if totalLen < padPrefixSize { return nil, errors.WithStack(io.ErrUnexpectedEOF) } blockLen := binary.LittleEndian.Uint32(paddedBlock) blockEndPos := int(blockLen + padPrefixSize) if totalLen < blockEndPos { return nil, errors...
go
func DepadBlock(paddedBlock []byte) ([]byte, error) { totalLen := len(paddedBlock) if totalLen < padPrefixSize { return nil, errors.WithStack(io.ErrUnexpectedEOF) } blockLen := binary.LittleEndian.Uint32(paddedBlock) blockEndPos := int(blockLen + padPrefixSize) if totalLen < blockEndPos { return nil, errors...
[ "func", "DepadBlock", "(", "paddedBlock", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "totalLen", ":=", "len", "(", "paddedBlock", ")", "\n", "if", "totalLen", "<", "padPrefixSize", "{", "return", "nil", ",", "errors", ".", ...
// DepadBlock extracts the actual block data from a padded block.
[ "DepadBlock", "extracts", "the", "actual", "block", "data", "from", "a", "padded", "block", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/pad.go#L55-L72
160,727
keybase/client
go/client/cmd_prove.go
ParseArgv
func (p *CmdProve) ParseArgv(ctx *cli.Context) error { nargs := len(ctx.Args()) p.arg.Force = ctx.Bool("force") p.listServices = ctx.Bool("list-services") p.output = ctx.String("output") if p.listServices { return nil } if nargs > 2 || nargs == 0 { return fmt.Errorf("prove takes 1 or 2 args: <service> [<us...
go
func (p *CmdProve) ParseArgv(ctx *cli.Context) error { nargs := len(ctx.Args()) p.arg.Force = ctx.Bool("force") p.listServices = ctx.Bool("list-services") p.output = ctx.String("output") if p.listServices { return nil } if nargs > 2 || nargs == 0 { return fmt.Errorf("prove takes 1 or 2 args: <service> [<us...
[ "func", "(", "p", "*", "CmdProve", ")", "ParseArgv", "(", "ctx", "*", "cli", ".", "Context", ")", "error", "{", "nargs", ":=", "len", "(", "ctx", ".", "Args", "(", ")", ")", "\n", "p", ".", "arg", ".", "Force", "=", "ctx", ".", "Bool", "(", "...
// ParseArgv parses arguments for the prove command.
[ "ParseArgv", "parses", "arguments", "for", "the", "prove", "command", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_prove.go#L30-L55
160,728
keybase/client
go/client/cmd_prove.go
NewCmdProve
func NewCmdProve(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command { cmd := cli.Command{ Name: "prove", ArgumentHelp: "<service> [service username]", Usage: "Generate a new proof", Description: "Run keybase prove --list-services to see available services.", Flags: []cli.Flag{ ...
go
func NewCmdProve(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command { cmd := cli.Command{ Name: "prove", ArgumentHelp: "<service> [service username]", Usage: "Generate a new proof", Description: "Run keybase prove --list-services to see available services.", Flags: []cli.Flag{ ...
[ "func", "NewCmdProve", "(", "cl", "*", "libcmdline", ".", "CommandLine", ",", "g", "*", "libkb", ".", "GlobalContext", ")", "cli", ".", "Command", "{", "cmd", ":=", "cli", ".", "Command", "{", "Name", ":", "\"", "\"", ",", "ArgumentHelp", ":", "\"", ...
// NewCmdProve makes a new prove command from the given CLI parameters.
[ "NewCmdProve", "makes", "a", "new", "prove", "command", "from", "the", "given", "CLI", "parameters", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_prove.go#L121-L147
160,729
keybase/client
go/client/cmd_prove.go
NewCmdProveRooterRunner
func NewCmdProveRooterRunner(g *libkb.GlobalContext, username string) *CmdProve { return &CmdProve{ Contextified: libkb.NewContextified(g), arg: keybase1.StartProofArg{ Service: "rooter", Username: username, Auto: true, }, } }
go
func NewCmdProveRooterRunner(g *libkb.GlobalContext, username string) *CmdProve { return &CmdProve{ Contextified: libkb.NewContextified(g), arg: keybase1.StartProofArg{ Service: "rooter", Username: username, Auto: true, }, } }
[ "func", "NewCmdProveRooterRunner", "(", "g", "*", "libkb", ".", "GlobalContext", ",", "username", "string", ")", "*", "CmdProve", "{", "return", "&", "CmdProve", "{", "Contextified", ":", "libkb", ".", "NewContextified", "(", "g", ")", ",", "arg", ":", "ke...
// NewCmdProveRooterRunner creates a CmdProve for proving rooter in tests.
[ "NewCmdProveRooterRunner", "creates", "a", "CmdProve", "for", "proving", "rooter", "in", "tests", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_prove.go#L150-L159
160,730
keybase/client
go/client/cmd_prove.go
GetUsage
func (p *CmdProve) GetUsage() libkb.Usage { return libkb.Usage{ Config: true, API: true, KbKeyring: true, } }
go
func (p *CmdProve) GetUsage() libkb.Usage { return libkb.Usage{ Config: true, API: true, KbKeyring: true, } }
[ "func", "(", "p", "*", "CmdProve", ")", "GetUsage", "(", ")", "libkb", ".", "Usage", "{", "return", "libkb", ".", "Usage", "{", "Config", ":", "true", ",", "API", ":", "true", ",", "KbKeyring", ":", "true", ",", "}", "\n", "}" ]
// GetUsage specifics the library features that the prove command needs.
[ "GetUsage", "specifics", "the", "library", "features", "that", "the", "prove", "command", "needs", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_prove.go#L162-L168
160,731
keybase/client
go/kbfs/tlf/handle_extension.go
String
func (et HandleExtensionType) String(username kbname.NormalizedUsername) string { switch et { case HandleExtensionConflict: return handleExtensionConflictString case HandleExtensionFinalized: if len(username) != 0 { username += " " } return fmt.Sprintf(handleExtensionFinalizedString, username) } return ...
go
func (et HandleExtensionType) String(username kbname.NormalizedUsername) string { switch et { case HandleExtensionConflict: return handleExtensionConflictString case HandleExtensionFinalized: if len(username) != 0 { username += " " } return fmt.Sprintf(handleExtensionFinalizedString, username) } return ...
[ "func", "(", "et", "HandleExtensionType", ")", "String", "(", "username", "kbname", ".", "NormalizedUsername", ")", "string", "{", "switch", "et", "{", "case", "HandleExtensionConflict", ":", "return", "handleExtensionConflictString", "\n", "case", "HandleExtensionFin...
// String implements the fmt.Stringer interface for HandleExtensionType
[ "String", "implements", "the", "fmt", ".", "Stringer", "interface", "for", "HandleExtensionType" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L72-L83
160,732
keybase/client
go/kbfs/tlf/handle_extension.go
parseHandleExtensionString
func parseHandleExtensionString(s string) (HandleExtensionType, kbname.NormalizedUsername) { if handleExtensionConflictString == s { return HandleExtensionConflict, "" } m := handleExtensionFinalizedRegex.FindStringSubmatch(s) if len(m) < 2 { return HandleExtensionUnknown, "" } return HandleExtensionFinalized...
go
func parseHandleExtensionString(s string) (HandleExtensionType, kbname.NormalizedUsername) { if handleExtensionConflictString == s { return HandleExtensionConflict, "" } m := handleExtensionFinalizedRegex.FindStringSubmatch(s) if len(m) < 2 { return HandleExtensionUnknown, "" } return HandleExtensionFinalized...
[ "func", "parseHandleExtensionString", "(", "s", "string", ")", "(", "HandleExtensionType", ",", "kbname", ".", "NormalizedUsername", ")", "{", "if", "handleExtensionConflictString", "==", "s", "{", "return", "HandleExtensionConflict", ",", "\"", "\"", "\n", "}", "...
// parseHandleExtensionString parses an extension type and optional username from a string.
[ "parseHandleExtensionString", "parses", "an", "extension", "type", "and", "optional", "username", "from", "a", "string", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L86-L95
160,733
keybase/client
go/kbfs/tlf/handle_extension.go
NewHandleExtension
func NewHandleExtension(extType HandleExtensionType, num uint16, un kbname.NormalizedUsername, now time.Time) ( *HandleExtension, error) { return newHandleExtension(extType, num, un, now) }
go
func NewHandleExtension(extType HandleExtensionType, num uint16, un kbname.NormalizedUsername, now time.Time) ( *HandleExtension, error) { return newHandleExtension(extType, num, un, now) }
[ "func", "NewHandleExtension", "(", "extType", "HandleExtensionType", ",", "num", "uint16", ",", "un", "kbname", ".", "NormalizedUsername", ",", "now", "time", ".", "Time", ")", "(", "*", "HandleExtension", ",", "error", ")", "{", "return", "newHandleExtension", ...
// NewHandleExtension returns a new HandleExtension struct // populated with the date from the given time and conflict number.
[ "NewHandleExtension", "returns", "a", "new", "HandleExtension", "struct", "populated", "with", "the", "date", "from", "the", "given", "time", "and", "conflict", "number", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L150-L153
160,734
keybase/client
go/kbfs/tlf/handle_extension.go
newHandleExtension
func newHandleExtension(extType HandleExtensionType, num uint16, un kbname.NormalizedUsername, now time.Time) ( *HandleExtension, error) { if num == 0 { return nil, errHandleExtensionInvalidNumber } // mask out everything but the date date := now.UTC().Format(handleExtensionDateFormat) now, err := time.Parse(ha...
go
func newHandleExtension(extType HandleExtensionType, num uint16, un kbname.NormalizedUsername, now time.Time) ( *HandleExtension, error) { if num == 0 { return nil, errHandleExtensionInvalidNumber } // mask out everything but the date date := now.UTC().Format(handleExtensionDateFormat) now, err := time.Parse(ha...
[ "func", "newHandleExtension", "(", "extType", "HandleExtensionType", ",", "num", "uint16", ",", "un", "kbname", ".", "NormalizedUsername", ",", "now", "time", ".", "Time", ")", "(", "*", "HandleExtension", ",", "error", ")", "{", "if", "num", "==", "0", "{...
// Helper to instantiate a HandleExtension object.
[ "Helper", "to", "instantiate", "a", "HandleExtension", "object", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L164-L181
160,735
keybase/client
go/kbfs/tlf/handle_extension.go
parseHandleExtension
func parseHandleExtension(fields []string) (*HandleExtension, error) { if len(fields) != 4 { return nil, errHandleExtensionInvalidString } extType, un := parseHandleExtensionString(fields[1]) if extType == HandleExtensionUnknown { return nil, errHandleExtensionInvalidString } date, err := time.Parse(handleExt...
go
func parseHandleExtension(fields []string) (*HandleExtension, error) { if len(fields) != 4 { return nil, errHandleExtensionInvalidString } extType, un := parseHandleExtensionString(fields[1]) if extType == HandleExtensionUnknown { return nil, errHandleExtensionInvalidString } date, err := time.Parse(handleExt...
[ "func", "parseHandleExtension", "(", "fields", "[", "]", "string", ")", "(", "*", "HandleExtension", ",", "error", ")", "{", "if", "len", "(", "fields", ")", "!=", "4", "{", "return", "nil", ",", "errHandleExtensionInvalidString", "\n", "}", "\n", "extType...
// parseHandleExtension parses a HandleExtension array of string fields.
[ "parseHandleExtension", "parses", "a", "HandleExtension", "array", "of", "string", "fields", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L184-L212
160,736
keybase/client
go/kbfs/tlf/handle_extension.go
ParseHandleExtensionSuffix
func ParseHandleExtensionSuffix(s string) ([]HandleExtension, error) { exts := handleExtensionRegex.FindAllStringSubmatch(s, 2) if len(exts) < 1 || len(exts) > 2 { return nil, errHandleExtensionInvalidString } extMap := make(map[HandleExtensionType]bool) var extensions []HandleExtension for _, e := range exts {...
go
func ParseHandleExtensionSuffix(s string) ([]HandleExtension, error) { exts := handleExtensionRegex.FindAllStringSubmatch(s, 2) if len(exts) < 1 || len(exts) > 2 { return nil, errHandleExtensionInvalidString } extMap := make(map[HandleExtensionType]bool) var extensions []HandleExtension for _, e := range exts {...
[ "func", "ParseHandleExtensionSuffix", "(", "s", "string", ")", "(", "[", "]", "HandleExtension", ",", "error", ")", "{", "exts", ":=", "handleExtensionRegex", ".", "FindAllStringSubmatch", "(", "s", ",", "2", ")", "\n", "if", "len", "(", "exts", ")", "<", ...
// ParseHandleExtensionSuffix parses a TLF handle extension suffix string.
[ "ParseHandleExtensionSuffix", "parses", "a", "TLF", "handle", "extension", "suffix", "string", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L215-L235
160,737
keybase/client
go/kbfs/tlf/handle_extension.go
newHandleExtensionSuffix
func newHandleExtensionSuffix( extensions []HandleExtension, isBackedByTeam bool) string { var suffix string for _, extension := range extensions { suffix += HandleExtensionSep suffix += extension.string(isBackedByTeam) } return suffix }
go
func newHandleExtensionSuffix( extensions []HandleExtension, isBackedByTeam bool) string { var suffix string for _, extension := range extensions { suffix += HandleExtensionSep suffix += extension.string(isBackedByTeam) } return suffix }
[ "func", "newHandleExtensionSuffix", "(", "extensions", "[", "]", "HandleExtension", ",", "isBackedByTeam", "bool", ")", "string", "{", "var", "suffix", "string", "\n", "for", "_", ",", "extension", ":=", "range", "extensions", "{", "suffix", "+=", "HandleExtensi...
// newHandleExtensionSuffix creates a suffix string given a set of extensions.
[ "newHandleExtensionSuffix", "creates", "a", "suffix", "string", "given", "a", "set", "of", "extensions", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/handle_extension.go#L238-L246
160,738
keybase/client
go/chat/storage/storage_delh.go
setDeletedUpto
func (t *delhTracker) setDeletedUpto(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, msgid chat1.MessageID) Error { entry, err := t.getEntry(ctx, convID, uid) switch err.(type) { case nil: case MissError: default: return err } entry.MaxDeleteHistoryUpto = msgid entry.MinDeletableMessage =...
go
func (t *delhTracker) setDeletedUpto(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID, msgid chat1.MessageID) Error { entry, err := t.getEntry(ctx, convID, uid) switch err.(type) { case nil: case MissError: default: return err } entry.MaxDeleteHistoryUpto = msgid entry.MinDeletableMessage =...
[ "func", "(", "t", "*", "delhTracker", ")", "setDeletedUpto", "(", "ctx", "context", ".", "Context", ",", "convID", "chat1", ".", "ConversationID", ",", "uid", "gregor1", ".", "UID", ",", "msgid", "chat1", ".", "MessageID", ")", "Error", "{", "entry", ","...
// Set both values to msgid
[ "Set", "both", "values", "to", "msgid" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage_delh.go#L120-L133
160,739
keybase/client
go/kbfs/libfuse/updates_file.go
Write
func (f *UpdatesFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error) { f.folder.fs.log.CDebugf(ctx, "UpdatesFile (enable: %t) Write", f.enable) defer func() { err = f.folder.processError(ctx, libkbfs.WriteMode, err) }() if len(req.Data) == 0 { return nil } f.folder.upd...
go
func (f *UpdatesFile) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error) { f.folder.fs.log.CDebugf(ctx, "UpdatesFile (enable: %t) Write", f.enable) defer func() { err = f.folder.processError(ctx, libkbfs.WriteMode, err) }() if len(req.Data) == 0 { return nil } f.folder.upd...
[ "func", "(", "f", "*", "UpdatesFile", ")", "Write", "(", "ctx", "context", ".", "Context", ",", "req", "*", "fuse", ".", "WriteRequest", ",", "resp", "*", "fuse", ".", "WriteResponse", ")", "(", "err", "error", ")", "{", "f", ".", "folder", ".", "f...
// Write implements the fs.HandleWriter interface for UpdatesFile.
[ "Write", "implements", "the", "fs", ".", "HandleWriter", "interface", "for", "UpdatesFile", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/updates_file.go#L42-L84
160,740
keybase/client
go/bind/extension.go
ExtensionForceGC
func ExtensionForceGC() { var m runtime.MemStats runtime.ReadMemStats(&m) // Free up gc memory first fmt.Printf("mem stats (before): alloc: %v sys: %v\n", m.Alloc, m.Sys) fmt.Printf("Starting force gc\n") debug.FreeOSMemory() fmt.Printf("Done force gc\n") runtime.ReadMemStats(&m) fmt.Printf("mem stats (after)...
go
func ExtensionForceGC() { var m runtime.MemStats runtime.ReadMemStats(&m) // Free up gc memory first fmt.Printf("mem stats (before): alloc: %v sys: %v\n", m.Alloc, m.Sys) fmt.Printf("Starting force gc\n") debug.FreeOSMemory() fmt.Printf("Done force gc\n") runtime.ReadMemStats(&m) fmt.Printf("mem stats (after)...
[ "func", "ExtensionForceGC", "(", ")", "{", "var", "m", "runtime", ".", "MemStats", "\n", "runtime", ".", "ReadMemStats", "(", "&", "m", ")", "\n\n", "// Free up gc memory first", "fmt", ".", "Printf", "(", "\"", "\\n", "\"", ",", "m", ".", "Alloc", ",", ...
// ExtensionForceGC Forces a gc
[ "ExtensionForceGC", "Forces", "a", "gc" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/bind/extension.go#L715-L747
160,741
keybase/client
go/libkb/identify2_cache.go
NewIdentify2Cache
func NewIdentify2Cache(maxAge time.Duration) *Identify2Cache { res := &Identify2Cache{ cache: ramcache.New(), } res.cache.MaxAge = maxAge res.cache.TTL = maxAge return res }
go
func NewIdentify2Cache(maxAge time.Duration) *Identify2Cache { res := &Identify2Cache{ cache: ramcache.New(), } res.cache.MaxAge = maxAge res.cache.TTL = maxAge return res }
[ "func", "NewIdentify2Cache", "(", "maxAge", "time", ".", "Duration", ")", "*", "Identify2Cache", "{", "res", ":=", "&", "Identify2Cache", "{", "cache", ":", "ramcache", ".", "New", "(", ")", ",", "}", "\n", "res", ".", "cache", ".", "MaxAge", "=", "max...
// NewIdentify2Cache creates a Identify2Cache and sets the object max age to // maxAge. Once a user is inserted, after maxAge duration passes, // the user will be removed from the cache.
[ "NewIdentify2Cache", "creates", "a", "Identify2Cache", "and", "sets", "the", "object", "max", "age", "to", "maxAge", ".", "Once", "a", "user", "is", "inserted", "after", "maxAge", "duration", "passes", "the", "user", "will", "be", "removed", "from", "the", "...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/identify2_cache.go#L35-L42
160,742
keybase/client
go/libkb/identify2_cache.go
Get
func (c *Identify2Cache) Get(uid keybase1.UID, gctf GetCheckTimeFunc, gcdf GetCacheDurationFunc, breaksOK bool) (*keybase1.Identify2ResUPK2, error) { v, err := c.cache.Get(string(uid)) if err != nil { if err == ramcache.ErrNotFound { return nil, nil } return nil, err } up, ok := v.(*keybase1.Identify2ResUP...
go
func (c *Identify2Cache) Get(uid keybase1.UID, gctf GetCheckTimeFunc, gcdf GetCacheDurationFunc, breaksOK bool) (*keybase1.Identify2ResUPK2, error) { v, err := c.cache.Get(string(uid)) if err != nil { if err == ramcache.ErrNotFound { return nil, nil } return nil, err } up, ok := v.(*keybase1.Identify2ResUP...
[ "func", "(", "c", "*", "Identify2Cache", ")", "Get", "(", "uid", "keybase1", ".", "UID", ",", "gctf", "GetCheckTimeFunc", ",", "gcdf", "GetCacheDurationFunc", ",", "breaksOK", "bool", ")", "(", "*", "keybase1", ".", "Identify2ResUPK2", ",", "error", ")", "...
// Get returns a user object. If none exists for uid, it will return nil.
[ "Get", "returns", "a", "user", "object", ".", "If", "none", "exists", "for", "uid", "it", "will", "return", "nil", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/identify2_cache.go#L45-L75
160,743
keybase/client
go/libkb/identify2_cache.go
Insert
func (c *Identify2Cache) Insert(up *keybase1.Identify2ResUPK2) error { tmp := *up copy := &tmp copy.Upk.Uvv.CachedAt = keybase1.ToTime(time.Now()) return c.cache.Set(string(up.Upk.GetUID()), copy) }
go
func (c *Identify2Cache) Insert(up *keybase1.Identify2ResUPK2) error { tmp := *up copy := &tmp copy.Upk.Uvv.CachedAt = keybase1.ToTime(time.Now()) return c.cache.Set(string(up.Upk.GetUID()), copy) }
[ "func", "(", "c", "*", "Identify2Cache", ")", "Insert", "(", "up", "*", "keybase1", ".", "Identify2ResUPK2", ")", "error", "{", "tmp", ":=", "*", "up", "\n", "copy", ":=", "&", "tmp", "\n", "copy", ".", "Upk", ".", "Uvv", ".", "CachedAt", "=", "key...
// Insert adds a user to the cache, keyed on UID.
[ "Insert", "adds", "a", "user", "to", "the", "cache", "keyed", "on", "UID", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/identify2_cache.go#L78-L83
160,744
keybase/client
go/kbfs/data/bsplitter_simple.go
NewBlockSplitterSimple
func NewBlockSplitterSimple(desiredBlockSize int64, blockChangeEmbedMaxSize uint64, codec kbfscodec.Codec) ( *BlockSplitterSimple, error) { // If the desired block size is exactly a power of 2, subtract one // from it to account for the padding we will do, which rounds up // when the encoded size is exactly a powe...
go
func NewBlockSplitterSimple(desiredBlockSize int64, blockChangeEmbedMaxSize uint64, codec kbfscodec.Codec) ( *BlockSplitterSimple, error) { // If the desired block size is exactly a power of 2, subtract one // from it to account for the padding we will do, which rounds up // when the encoded size is exactly a powe...
[ "func", "NewBlockSplitterSimple", "(", "desiredBlockSize", "int64", ",", "blockChangeEmbedMaxSize", "uint64", ",", "codec", "kbfscodec", ".", "Codec", ")", "(", "*", "BlockSplitterSimple", ",", "error", ")", "{", "// If the desired block size is exactly a power of 2, subtra...
// NewBlockSplitterSimple creates a new BlockSplittleSimple and // adjusts the max size to try to match the desired size for file // blocks, given the overhead of encoding a file block and the // round-up padding we do.
[ "NewBlockSplitterSimple", "creates", "a", "new", "BlockSplittleSimple", "and", "adjusts", "the", "max", "size", "to", "try", "to", "match", "the", "desired", "size", "for", "file", "blocks", "given", "the", "overhead", "of", "encoding", "a", "file", "block", "...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/bsplitter_simple.go#L42-L114
160,745
keybase/client
go/kbfs/data/bsplitter_simple.go
NewBlockSplitterSimpleExact
func NewBlockSplitterSimpleExact( maxSize int64, maxPtrsPerBlock int, blockChangeEmbedMaxSize uint64) ( *BlockSplitterSimple, error) { maxDirEntriesPerBlock, err := getMaxDirEntriesPerBlock() if err != nil { return nil, err } return &BlockSplitterSimple{ maxSize: maxSize, maxPtrsPerBlock: ...
go
func NewBlockSplitterSimpleExact( maxSize int64, maxPtrsPerBlock int, blockChangeEmbedMaxSize uint64) ( *BlockSplitterSimple, error) { maxDirEntriesPerBlock, err := getMaxDirEntriesPerBlock() if err != nil { return nil, err } return &BlockSplitterSimple{ maxSize: maxSize, maxPtrsPerBlock: ...
[ "func", "NewBlockSplitterSimpleExact", "(", "maxSize", "int64", ",", "maxPtrsPerBlock", "int", ",", "blockChangeEmbedMaxSize", "uint64", ")", "(", "*", "BlockSplitterSimple", ",", "error", ")", "{", "maxDirEntriesPerBlock", ",", "err", ":=", "getMaxDirEntriesPerBlock", ...
// NewBlockSplitterSimpleExact returns a BlockSplitterSimple with the // max block size set to an exact value.
[ "NewBlockSplitterSimpleExact", "returns", "a", "BlockSplitterSimple", "with", "the", "max", "block", "size", "set", "to", "an", "exact", "value", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/bsplitter_simple.go#L118-L131
160,746
keybase/client
go/kbfs/data/bsplitter_simple.go
SetMaxDirEntriesByBlockSize
func (b *BlockSplitterSimple) SetMaxDirEntriesByBlockSize( codec kbfscodec.Codec) error { dirEnv := os.Getenv("KEYBASE_BSPLIT_MAX_DIR_ENTRIES") if len(dirEnv) > 0 { // Don't override the environment variable. return nil } block := NewDirBlock().(*DirBlock) bigName := strings.Repeat("a", MaxNameBytesDefault) ...
go
func (b *BlockSplitterSimple) SetMaxDirEntriesByBlockSize( codec kbfscodec.Codec) error { dirEnv := os.Getenv("KEYBASE_BSPLIT_MAX_DIR_ENTRIES") if len(dirEnv) > 0 { // Don't override the environment variable. return nil } block := NewDirBlock().(*DirBlock) bigName := strings.Repeat("a", MaxNameBytesDefault) ...
[ "func", "(", "b", "*", "BlockSplitterSimple", ")", "SetMaxDirEntriesByBlockSize", "(", "codec", "kbfscodec", ".", "Codec", ")", "error", "{", "dirEnv", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", "\n", "if", "len", "(", "dirEnv", ")", ">", "0", "{...
// SetMaxDirEntriesByBlockSize sets the maximum number of directory // entries per directory block, based on the maximum block size. If // the `KEYBASE_BSPLIT_MAX_DIR_ENTRIES` is set, this function does // nothing.
[ "SetMaxDirEntriesByBlockSize", "sets", "the", "maximum", "number", "of", "directory", "entries", "per", "directory", "block", "based", "on", "the", "maximum", "block", "size", ".", "If", "the", "KEYBASE_BSPLIT_MAX_DIR_ENTRIES", "is", "set", "this", "function", "does...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/bsplitter_simple.go#L137-L177
160,747
keybase/client
go/kbfs/data/bsplitter_simple.go
CopyUntilSplit
func (b *BlockSplitterSimple) CopyUntilSplit( block *FileBlock, lastBlock bool, data []byte, off int64) int64 { n := int64(len(data)) currLen := int64(len(block.Contents)) // lastBlock is irrelevant since we only copy fixed sizes toCopy := n if currLen < (off + n) { moreNeeded := (n + off) - currLen // Reduc...
go
func (b *BlockSplitterSimple) CopyUntilSplit( block *FileBlock, lastBlock bool, data []byte, off int64) int64 { n := int64(len(data)) currLen := int64(len(block.Contents)) // lastBlock is irrelevant since we only copy fixed sizes toCopy := n if currLen < (off + n) { moreNeeded := (n + off) - currLen // Reduc...
[ "func", "(", "b", "*", "BlockSplitterSimple", ")", "CopyUntilSplit", "(", "block", "*", "FileBlock", ",", "lastBlock", "bool", ",", "data", "[", "]", "byte", ",", "off", "int64", ")", "int64", "{", "n", ":=", "int64", "(", "len", "(", "data", ")", ")...
// CopyUntilSplit implements the BlockSplitter interface for // BlockSplitterSimple.
[ "CopyUntilSplit", "implements", "the", "BlockSplitter", "interface", "for", "BlockSplitterSimple", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/bsplitter_simple.go#L181-L215
160,748
keybase/client
go/kbfs/data/bsplitter_simple.go
SplitDirIfNeeded
func (b *BlockSplitterSimple) SplitDirIfNeeded(block *DirBlock) ( []*DirBlock, *StringOffset) { if block.IsIndirect() { panic("SplitDirIfNeeded must be given only a direct block") } if b.maxDirEntriesPerBlock == 0 || len(block.Children) <= b.maxDirEntriesPerBlock { return []*DirBlock{block}, nil } // Sort...
go
func (b *BlockSplitterSimple) SplitDirIfNeeded(block *DirBlock) ( []*DirBlock, *StringOffset) { if block.IsIndirect() { panic("SplitDirIfNeeded must be given only a direct block") } if b.maxDirEntriesPerBlock == 0 || len(block.Children) <= b.maxDirEntriesPerBlock { return []*DirBlock{block}, nil } // Sort...
[ "func", "(", "b", "*", "BlockSplitterSimple", ")", "SplitDirIfNeeded", "(", "block", "*", "DirBlock", ")", "(", "[", "]", "*", "DirBlock", ",", "*", "StringOffset", ")", "{", "if", "block", ".", "IsIndirect", "(", ")", "{", "panic", "(", "\"", "\"", ...
// SplitDirIfNeeded implements the BlockSplitter interface for // BlockSplitterSimple.
[ "SplitDirIfNeeded", "implements", "the", "BlockSplitter", "interface", "for", "BlockSplitterSimple", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/bsplitter_simple.go#L238-L266
160,749
keybase/client
go/logger/adapter.go
Debugf
func (l logf) Debugf(s string, args ...interface{}) { l.log.Debug(s, args...) }
go
func (l logf) Debugf(s string, args ...interface{}) { l.log.Debug(s, args...) }
[ "func", "(", "l", "logf", ")", "Debugf", "(", "s", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "l", ".", "log", ".", "Debug", "(", "s", ",", "args", "...", ")", "\n", "}" ]
// Debugf forwards to Logger.Debug
[ "Debugf", "forwards", "to", "Logger", ".", "Debug" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/adapter.go#L31-L33
160,750
keybase/client
go/logger/adapter.go
Infof
func (l logf) Infof(s string, args ...interface{}) { l.log.Info(s, args...) }
go
func (l logf) Infof(s string, args ...interface{}) { l.log.Info(s, args...) }
[ "func", "(", "l", "logf", ")", "Infof", "(", "s", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "l", ".", "log", ".", "Info", "(", "s", ",", "args", "...", ")", "\n", "}" ]
// Infof forwards to Logger.Info
[ "Infof", "forwards", "to", "Logger", ".", "Info" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/adapter.go#L36-L38
160,751
keybase/client
go/logger/adapter.go
Warningf
func (l logf) Warningf(s string, args ...interface{}) { l.log.Warning(s, args...) }
go
func (l logf) Warningf(s string, args ...interface{}) { l.log.Warning(s, args...) }
[ "func", "(", "l", "logf", ")", "Warningf", "(", "s", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "l", ".", "log", ".", "Warning", "(", "s", ",", "args", "...", ")", "\n", "}" ]
// Warningf forwards to Logger.Warning
[ "Warningf", "forwards", "to", "Logger", ".", "Warning" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/adapter.go#L41-L43
160,752
keybase/client
go/logger/adapter.go
Errorf
func (l logf) Errorf(s string, args ...interface{}) { l.log.Errorf(s, args...) }
go
func (l logf) Errorf(s string, args ...interface{}) { l.log.Errorf(s, args...) }
[ "func", "(", "l", "logf", ")", "Errorf", "(", "s", "string", ",", "args", "...", "interface", "{", "}", ")", "{", "l", ".", "log", ".", "Errorf", "(", "s", ",", "args", "...", ")", "\n", "}" ]
// Errorf forwards to Logger.Errorf
[ "Errorf", "forwards", "to", "Logger", ".", "Errorf" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/adapter.go#L46-L48
160,753
keybase/client
go/libkb/delegatekeyaggregator.go
AddPerUserKeyServerArg
func AddPerUserKeyServerArg(serverArg JSONPayload, generation keybase1.PerUserKeyGeneration, pukBoxes []keybase1.PerUserKeyBox, pukPrev *PerUserKeyPrev) { section := make(JSONPayload) section["boxes"] = pukBoxes section["generation"] = generation if pukPrev != nil { section["prev"] = *pukPrev } serverArg["per_...
go
func AddPerUserKeyServerArg(serverArg JSONPayload, generation keybase1.PerUserKeyGeneration, pukBoxes []keybase1.PerUserKeyBox, pukPrev *PerUserKeyPrev) { section := make(JSONPayload) section["boxes"] = pukBoxes section["generation"] = generation if pukPrev != nil { section["prev"] = *pukPrev } serverArg["per_...
[ "func", "AddPerUserKeyServerArg", "(", "serverArg", "JSONPayload", ",", "generation", "keybase1", ".", "PerUserKeyGeneration", ",", "pukBoxes", "[", "]", "keybase1", ".", "PerUserKeyBox", ",", "pukPrev", "*", "PerUserKeyPrev", ")", "{", "section", ":=", "make", "(...
// Make the "per_user_key" section of an API arg. // Requires one or more `pukBoxes` // `pukPrev` is optional. // Modifies `serverArg`.
[ "Make", "the", "per_user_key", "section", "of", "an", "API", "arg", ".", "Requires", "one", "or", "more", "pukBoxes", "pukPrev", "is", "optional", ".", "Modifies", "serverArg", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/delegatekeyaggregator.go#L88-L97
160,754
keybase/client
go/libkb/delegatekeyaggregator.go
AddUserEKReBoxServerArg
func AddUserEKReBoxServerArg(serverArg JSONPayload, arg *keybase1.UserEkReboxArg) { if arg == nil { return } serverArg["device_eks"] = map[string]string{string(arg.DeviceID): arg.DeviceEkStatementSig} serverArg["user_ek_rebox"] = arg.UserEkBoxMetadata }
go
func AddUserEKReBoxServerArg(serverArg JSONPayload, arg *keybase1.UserEkReboxArg) { if arg == nil { return } serverArg["device_eks"] = map[string]string{string(arg.DeviceID): arg.DeviceEkStatementSig} serverArg["user_ek_rebox"] = arg.UserEkBoxMetadata }
[ "func", "AddUserEKReBoxServerArg", "(", "serverArg", "JSONPayload", ",", "arg", "*", "keybase1", ".", "UserEkReboxArg", ")", "{", "if", "arg", "==", "nil", "{", "return", "\n", "}", "\n", "serverArg", "[", "\"", "\"", "]", "=", "map", "[", "string", "]",...
// Make the "user_ek_rebox" and "device_eks" section of an API arg. Modifies // `serverArg` unless arg is nil.
[ "Make", "the", "user_ek_rebox", "and", "device_eks", "section", "of", "an", "API", "arg", ".", "Modifies", "serverArg", "unless", "arg", "is", "nil", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/delegatekeyaggregator.go#L101-L107
160,755
keybase/client
go/service/scanproofs.go
ScanProofs
func (h *ScanProofsHandler) ScanProofs(ctx context.Context, arg keybase1.ScanProofsArg) error { uis := libkb.UIs{ LogUI: h.getLogUI(arg.SessionID), SessionID: arg.SessionID, } eng := engine.NewScanProofsEngine(arg.Infile, arg.Indices, arg.Sigid, arg.Ratelimit, arg.Cachefile, arg.Ignorefile, h.G()) m := libk...
go
func (h *ScanProofsHandler) ScanProofs(ctx context.Context, arg keybase1.ScanProofsArg) error { uis := libkb.UIs{ LogUI: h.getLogUI(arg.SessionID), SessionID: arg.SessionID, } eng := engine.NewScanProofsEngine(arg.Infile, arg.Indices, arg.Sigid, arg.Ratelimit, arg.Cachefile, arg.Ignorefile, h.G()) m := libk...
[ "func", "(", "h", "*", "ScanProofsHandler", ")", "ScanProofs", "(", "ctx", "context", ".", "Context", ",", "arg", "keybase1", ".", "ScanProofsArg", ")", "error", "{", "uis", ":=", "libkb", ".", "UIs", "{", "LogUI", ":", "h", ".", "getLogUI", "(", "arg"...
// ScanProofs creates a ScanProofsEngine and runs it.
[ "ScanProofs", "creates", "a", "ScanProofsEngine", "and", "runs", "it", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/scanproofs.go#L27-L35
160,756
keybase/client
go/chat/s3/s3.go
New
func New(signer Signer, region Region, client ...*http.Client) *S3 { var httpclient *http.Client if len(client) > 0 { httpclient = client[0] } return &S3{ Signer: signer, Region: region, AttemptStrategy: DefaultAttemptStrategy, client: httpclient, } }
go
func New(signer Signer, region Region, client ...*http.Client) *S3 { var httpclient *http.Client if len(client) > 0 { httpclient = client[0] } return &S3{ Signer: signer, Region: region, AttemptStrategy: DefaultAttemptStrategy, client: httpclient, } }
[ "func", "New", "(", "signer", "Signer", ",", "region", "Region", ",", "client", "...", "*", "http", ".", "Client", ")", "*", "S3", "{", "var", "httpclient", "*", "http", ".", "Client", "\n\n", "if", "len", "(", "client", ")", ">", "0", "{", "httpcl...
// New creates a new S3. Optional client argument allows for custom http.clients to be used.
[ "New", "creates", "a", "new", "S3", ".", "Optional", "client", "argument", "allows", "for", "custom", "http", ".", "clients", "to", "be", "used", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L136-L150
160,757
keybase/client
go/chat/s3/s3.go
GetReader
func (b *Bucket) GetReader(ctx context.Context, path string) (rc io.ReadCloser, err error) { resp, err := b.GetResponse(ctx, path) if resp != nil { return resp.Body, err } return nil, err }
go
func (b *Bucket) GetReader(ctx context.Context, path string) (rc io.ReadCloser, err error) { resp, err := b.GetResponse(ctx, path) if resp != nil { return resp.Body, err } return nil, err }
[ "func", "(", "b", "*", "Bucket", ")", "GetReader", "(", "ctx", "context", ".", "Context", ",", "path", "string", ")", "(", "rc", "io", ".", "ReadCloser", ",", "err", "error", ")", "{", "resp", ",", "err", ":=", "b", ".", "GetResponse", "(", "ctx", ...
// GetReader retrieves an object from an S3 bucket, // returning the body of the HTTP response. // It is the caller's responsibility to call Close on rc when // finished reading.
[ "GetReader", "retrieves", "an", "object", "from", "an", "S3", "bucket", "returning", "the", "body", "of", "the", "HTTP", "response", ".", "It", "is", "the", "caller", "s", "responsibility", "to", "call", "Close", "on", "rc", "when", "finished", "reading", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L248-L254
160,758
keybase/client
go/chat/s3/s3.go
GetReaderWithRange
func (b *Bucket) GetReaderWithRange(ctx context.Context, path string, begin, end int64) (rc io.ReadCloser, err error) { header := make(http.Header) header.Add("Range", fmt.Sprintf("bytes=%d-%d", begin, end-1)) resp, err := b.GetResponseWithHeaders(ctx, path, header) if resp != nil { return resp.Body, err } retu...
go
func (b *Bucket) GetReaderWithRange(ctx context.Context, path string, begin, end int64) (rc io.ReadCloser, err error) { header := make(http.Header) header.Add("Range", fmt.Sprintf("bytes=%d-%d", begin, end-1)) resp, err := b.GetResponseWithHeaders(ctx, path, header) if resp != nil { return resp.Body, err } retu...
[ "func", "(", "b", "*", "Bucket", ")", "GetReaderWithRange", "(", "ctx", "context", ".", "Context", ",", "path", "string", ",", "begin", ",", "end", "int64", ")", "(", "rc", "io", ".", "ReadCloser", ",", "err", "error", ")", "{", "header", ":=", "make...
// GetReaderWithRange retrieves an object from an S3 bucket using the specified range, // returning the body of the HTTP response. // It is the caller's responsibility to call Close on rc when // finished reading.
[ "GetReaderWithRange", "retrieves", "an", "object", "from", "an", "S3", "bucket", "using", "the", "specified", "range", "returning", "the", "body", "of", "the", "HTTP", "response", ".", "It", "is", "the", "caller", "s", "responsibility", "to", "call", "Close", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L260-L268
160,759
keybase/client
go/chat/s3/s3.go
GetResponse
func (b *Bucket) GetResponse(ctx context.Context, path string) (resp *http.Response, err error) { return b.GetResponseWithHeaders(ctx, path, make(http.Header)) }
go
func (b *Bucket) GetResponse(ctx context.Context, path string) (resp *http.Response, err error) { return b.GetResponseWithHeaders(ctx, path, make(http.Header)) }
[ "func", "(", "b", "*", "Bucket", ")", "GetResponse", "(", "ctx", "context", ".", "Context", ",", "path", "string", ")", "(", "resp", "*", "http", ".", "Response", ",", "err", "error", ")", "{", "return", "b", ".", "GetResponseWithHeaders", "(", "ctx", ...
// GetResponse retrieves an object from an S3 bucket, // returning the HTTP response. // It is the caller's responsibility to call Close on rc when // finished reading
[ "GetResponse", "retrieves", "an", "object", "from", "an", "S3", "bucket", "returning", "the", "HTTP", "response", ".", "It", "is", "the", "caller", "s", "responsibility", "to", "call", "Close", "on", "rc", "when", "finished", "reading" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L274-L276
160,760
keybase/client
go/chat/s3/s3.go
GetResponseWithHeaders
func (b *Bucket) GetResponseWithHeaders(ctx context.Context, path string, headers map[string][]string) (resp *http.Response, err error) { req := &request{ bucket: b.Name, path: path, headers: headers, } err = b.S3.prepare(req) if err != nil { return nil, err } for attempt := b.S3.AttemptStrategy.Start...
go
func (b *Bucket) GetResponseWithHeaders(ctx context.Context, path string, headers map[string][]string) (resp *http.Response, err error) { req := &request{ bucket: b.Name, path: path, headers: headers, } err = b.S3.prepare(req) if err != nil { return nil, err } for attempt := b.S3.AttemptStrategy.Start...
[ "func", "(", "b", "*", "Bucket", ")", "GetResponseWithHeaders", "(", "ctx", "context", ".", "Context", ",", "path", "string", ",", "headers", "map", "[", "string", "]", "[", "]", "string", ")", "(", "resp", "*", "http", ".", "Response", ",", "err", "...
// GetReaderWithHeaders retrieves an object from an S3 bucket // Accepts custom headers to be sent as the second parameter // returning the body of the HTTP response. // It is the caller's responsibility to call Close on rc when // finished reading
[ "GetReaderWithHeaders", "retrieves", "an", "object", "from", "an", "S3", "bucket", "Accepts", "custom", "headers", "to", "be", "sent", "as", "the", "second", "parameter", "returning", "the", "body", "of", "the", "HTTP", "response", ".", "It", "is", "the", "c...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L283-L304
160,761
keybase/client
go/chat/s3/s3.go
Exists
func (b *Bucket) Exists(path string) (exists bool, err error) { req := &request{ method: "HEAD", bucket: b.Name, path: path, } err = b.S3.prepare(req) if err != nil { return } for attempt := b.S3.AttemptStrategy.Start(); attempt.Next(); { resp, err := b.S3.run(context.Background(), req, nil) if sho...
go
func (b *Bucket) Exists(path string) (exists bool, err error) { req := &request{ method: "HEAD", bucket: b.Name, path: path, } err = b.S3.prepare(req) if err != nil { return } for attempt := b.S3.AttemptStrategy.Start(); attempt.Next(); { resp, err := b.S3.run(context.Background(), req, nil) if sho...
[ "func", "(", "b", "*", "Bucket", ")", "Exists", "(", "path", "string", ")", "(", "exists", "bool", ",", "err", "error", ")", "{", "req", ":=", "&", "request", "{", "method", ":", "\"", "\"", ",", "bucket", ":", "b", ".", "Name", ",", "path", ":...
// Exists checks whether or not an object exists on an S3 bucket using a HEAD request.
[ "Exists", "checks", "whether", "or", "not", "an", "object", "exists", "on", "an", "S3", "bucket", "using", "a", "HEAD", "request", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L307-L338
160,762
keybase/client
go/chat/s3/s3.go
PutCopy
func (b *Bucket) PutCopy(path string, perm ACL, options CopyOptions, source string) (result *CopyObjectResult, err error) { headers := map[string][]string{ "x-amz-acl": {string(perm)}, "x-amz-copy-source": {source}, } options.addHeaders(headers) req := &request{ method: "PUT", bucket: b.Name, pa...
go
func (b *Bucket) PutCopy(path string, perm ACL, options CopyOptions, source string) (result *CopyObjectResult, err error) { headers := map[string][]string{ "x-amz-acl": {string(perm)}, "x-amz-copy-source": {source}, } options.addHeaders(headers) req := &request{ method: "PUT", bucket: b.Name, pa...
[ "func", "(", "b", "*", "Bucket", ")", "PutCopy", "(", "path", "string", ",", "perm", "ACL", ",", "options", "CopyOptions", ",", "source", "string", ")", "(", "result", "*", "CopyObjectResult", ",", "err", "error", ")", "{", "headers", ":=", "map", "[",...
// PutCopy puts a copy of an object given by the key path into bucket b using b.Path as the target key
[ "PutCopy", "puts", "a", "copy", "of", "an", "object", "given", "by", "the", "key", "path", "into", "bucket", "b", "using", "b", ".", "Path", "as", "the", "target", "key" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L376-L399
160,763
keybase/client
go/chat/s3/s3.go
PutReader
func (b *Bucket) PutReader(ctx context.Context, path string, r io.Reader, length int64, contType string, perm ACL, options Options) error { headers := map[string][]string{ "Content-Length": {strconv.FormatInt(length, 10)}, "Content-Type": {contType}, "x-amz-acl": {string(perm)}, } options.addHeaders(hea...
go
func (b *Bucket) PutReader(ctx context.Context, path string, r io.Reader, length int64, contType string, perm ACL, options Options) error { headers := map[string][]string{ "Content-Length": {strconv.FormatInt(length, 10)}, "Content-Type": {contType}, "x-amz-acl": {string(perm)}, } options.addHeaders(hea...
[ "func", "(", "b", "*", "Bucket", ")", "PutReader", "(", "ctx", "context", ".", "Context", ",", "path", "string", ",", "r", "io", ".", "Reader", ",", "length", "int64", ",", "contType", "string", ",", "perm", "ACL", ",", "options", "Options", ")", "er...
// PutReader inserts an object into the S3 bucket by consuming data // from r until EOF.
[ "PutReader", "inserts", "an", "object", "into", "the", "S3", "bucket", "by", "consuming", "data", "from", "r", "until", "EOF", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L412-L427
160,764
keybase/client
go/chat/s3/s3.go
GetBucketContents
func (b *Bucket) GetBucketContents() (*map[string]Key, error) { bucketContents := map[string]Key{} prefix := "" pathSeparator := "" marker := "" for { contents, err := b.List(prefix, pathSeparator, marker, 1000) if err != nil { return &bucketContents, err } for _, key := range contents.Contents { buc...
go
func (b *Bucket) GetBucketContents() (*map[string]Key, error) { bucketContents := map[string]Key{} prefix := "" pathSeparator := "" marker := "" for { contents, err := b.List(prefix, pathSeparator, marker, 1000) if err != nil { return &bucketContents, err } for _, key := range contents.Contents { buc...
[ "func", "(", "b", "*", "Bucket", ")", "GetBucketContents", "(", ")", "(", "*", "map", "[", "string", "]", "Key", ",", "error", ")", "{", "bucketContents", ":=", "map", "[", "string", "]", "Key", "{", "}", "\n", "prefix", ":=", "\"", "\"", "\n", "...
// Returns a mapping of all key names in this bucket to Key objects
[ "Returns", "a", "mapping", "of", "all", "key", "names", "in", "this", "bucket", "to", "Key", "objects" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L766-L787
160,765
keybase/client
go/chat/s3/s3.go
prepare
func (s3 *S3) prepare(req *request) error { var signpath = req.path if !req.prepared { req.prepared = true if req.method == "" { req.method = "GET" } // Copy so they can be mutated without affecting on retries. params := make(url.Values) headers := make(http.Header) for k, v := range req.params { ...
go
func (s3 *S3) prepare(req *request) error { var signpath = req.path if !req.prepared { req.prepared = true if req.method == "" { req.method = "GET" } // Copy so they can be mutated without affecting on retries. params := make(url.Values) headers := make(http.Header) for k, v := range req.params { ...
[ "func", "(", "s3", "*", "S3", ")", "prepare", "(", "req", "*", "request", ")", "error", "{", "var", "signpath", "=", "req", ".", "path", "\n\n", "if", "!", "req", ".", "prepared", "{", "req", ".", "prepared", "=", "true", "\n", "if", "req", ".", ...
// prepare sets up req to be delivered to S3.
[ "prepare", "sets", "up", "req", "to", "be", "delivered", "to", "S3", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/s3.go#L866-L916
160,766
keybase/client
go/kbfs/dokan/cgo.go
getRequestorToken
func (fi *FileInfo) getRequestorToken() (syscall.Token, error) { hdl := syscall.Handle(C.kbfsLibdokan_OpenRequestorToken(fi.ptr)) var err error if hdl == syscall.InvalidHandle { // Tokens are value types, so returning nil is impossible, // returning an InvalidHandle is the best way. err = errors.New("Invalid h...
go
func (fi *FileInfo) getRequestorToken() (syscall.Token, error) { hdl := syscall.Handle(C.kbfsLibdokan_OpenRequestorToken(fi.ptr)) var err error if hdl == syscall.InvalidHandle { // Tokens are value types, so returning nil is impossible, // returning an InvalidHandle is the best way. err = errors.New("Invalid h...
[ "func", "(", "fi", "*", "FileInfo", ")", "getRequestorToken", "(", ")", "(", "syscall", ".", "Token", ",", "error", ")", "{", "hdl", ":=", "syscall", ".", "Handle", "(", "C", ".", "kbfsLibdokan_OpenRequestorToken", "(", "fi", ".", "ptr", ")", ")", "\n"...
// getRequestorToken returns the syscall.Token associated with // the requestor of this file system operation. Remember to // call Close on the Token.
[ "getRequestorToken", "returns", "the", "syscall", ".", "Token", "associated", "with", "the", "requestor", "of", "this", "file", "system", "operation", ".", "Remember", "to", "call", "Close", "on", "the", "Token", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/dokan/cgo.go#L695-L704
160,767
keybase/client
go/kbfs/dokan/cgo.go
isRequestorUserSidEqualTo
func (fi *FileInfo) isRequestorUserSidEqualTo(sid *winacl.SID) bool { tok, err := fi.getRequestorToken() if err != nil { debug("IsRequestorUserSidEqualTo:", err) return false } defer tok.Close() tokUser, err := tok.GetTokenUser() if err != nil { debug("IsRequestorUserSidEqualTo: GetTokenUser:", err) retur...
go
func (fi *FileInfo) isRequestorUserSidEqualTo(sid *winacl.SID) bool { tok, err := fi.getRequestorToken() if err != nil { debug("IsRequestorUserSidEqualTo:", err) return false } defer tok.Close() tokUser, err := tok.GetTokenUser() if err != nil { debug("IsRequestorUserSidEqualTo: GetTokenUser:", err) retur...
[ "func", "(", "fi", "*", "FileInfo", ")", "isRequestorUserSidEqualTo", "(", "sid", "*", "winacl", ".", "SID", ")", "bool", "{", "tok", ",", "err", ":=", "fi", ".", "getRequestorToken", "(", ")", "\n", "if", "err", "!=", "nil", "{", "debug", "(", "\"",...
// isRequestorUserSidEqualTo returns true if the sid passed as // the argument is equal to the sid of the user associated with // the filesystem request.
[ "isRequestorUserSidEqualTo", "returns", "true", "if", "the", "sid", "passed", "as", "the", "argument", "is", "equal", "to", "the", "sid", "of", "the", "user", "associated", "with", "the", "filesystem", "request", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/dokan/cgo.go#L709-L733
160,768
keybase/client
go/kbfs/dokan/cgo.go
unmount
func unmount(path string) error { debug("Unmount: Calling Dokan.Unmount") res := C.kbfsLibdokan_RemoveMountPoint((*C.WCHAR)(stringToUtf16Ptr(path))) if res == C.FALSE { debug("Unmount: Failed!") return errors.New("kbfsLibdokan_RemoveMountPoint failed") } debug("Unmount: Success!") return nil }
go
func unmount(path string) error { debug("Unmount: Calling Dokan.Unmount") res := C.kbfsLibdokan_RemoveMountPoint((*C.WCHAR)(stringToUtf16Ptr(path))) if res == C.FALSE { debug("Unmount: Failed!") return errors.New("kbfsLibdokan_RemoveMountPoint failed") } debug("Unmount: Success!") return nil }
[ "func", "unmount", "(", "path", "string", ")", "error", "{", "debug", "(", "\"", "\"", ")", "\n", "res", ":=", "C", ".", "kbfsLibdokan_RemoveMountPoint", "(", "(", "*", "C", ".", "WCHAR", ")", "(", "stringToUtf16Ptr", "(", "path", ")", ")", ")", "\n"...
// unmount a drive mounted by dokan.
[ "unmount", "a", "drive", "mounted", "by", "dokan", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/dokan/cgo.go#L741-L750
160,769
keybase/client
go/kbfs/dokan/cgo.go
stringToUtf16Buffer
func stringToUtf16Buffer(s string, ptr C.LPWSTR, blenUcs2 C.DWORD) bool { return stringToUtf16BufferPtr(s, unsafe.Pointer(ptr), blenUcs2) }
go
func stringToUtf16Buffer(s string, ptr C.LPWSTR, blenUcs2 C.DWORD) bool { return stringToUtf16BufferPtr(s, unsafe.Pointer(ptr), blenUcs2) }
[ "func", "stringToUtf16Buffer", "(", "s", "string", ",", "ptr", "C", ".", "LPWSTR", ",", "blenUcs2", "C", ".", "DWORD", ")", "bool", "{", "return", "stringToUtf16BufferPtr", "(", "s", ",", "unsafe", ".", "Pointer", "(", "ptr", ")", ",", "blenUcs2", ")", ...
// stringToUtf16Buffer pokes a string into a Windows wide string buffer. // On overflow does not poke anything and returns false.
[ "stringToUtf16Buffer", "pokes", "a", "string", "into", "a", "Windows", "wide", "string", "buffer", ".", "On", "overflow", "does", "not", "poke", "anything", "and", "returns", "false", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/dokan/cgo.go#L767-L769
160,770
keybase/client
go/kbfs/dokan/cgo.go
stringToUtf16Ptr
func stringToUtf16Ptr(s string) unsafe.Pointer { tmp := utf16.Encode([]rune(s + "\000")) return unsafe.Pointer(&tmp[0]) }
go
func stringToUtf16Ptr(s string) unsafe.Pointer { tmp := utf16.Encode([]rune(s + "\000")) return unsafe.Pointer(&tmp[0]) }
[ "func", "stringToUtf16Ptr", "(", "s", "string", ")", "unsafe", ".", "Pointer", "{", "tmp", ":=", "utf16", ".", "Encode", "(", "[", "]", "rune", "(", "s", "+", "\"", "\\000", "\"", ")", ")", "\n", "return", "unsafe", ".", "Pointer", "(", "&", "tmp",...
// stringToUtf16Ptr return a pointer to the string as utf16 with zero // termination.
[ "stringToUtf16Ptr", "return", "a", "pointer", "to", "the", "string", "as", "utf16", "with", "zero", "termination", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/dokan/cgo.go#L787-L790
160,771
keybase/client
go/libkb/runmode.go
StringToRunMode
func StringToRunMode(s string) (RunMode, error) { switch s { case string(DevelRunMode): return DevelRunMode, nil case string(ProductionRunMode): return ProductionRunMode, nil case string(StagingRunMode): return StagingRunMode, nil case "": return NoRunMode, nil default: return NoRunMode, fmt.Errorf("unk...
go
func StringToRunMode(s string) (RunMode, error) { switch s { case string(DevelRunMode): return DevelRunMode, nil case string(ProductionRunMode): return ProductionRunMode, nil case string(StagingRunMode): return StagingRunMode, nil case "": return NoRunMode, nil default: return NoRunMode, fmt.Errorf("unk...
[ "func", "StringToRunMode", "(", "s", "string", ")", "(", "RunMode", ",", "error", ")", "{", "switch", "s", "{", "case", "string", "(", "DevelRunMode", ")", ":", "return", "DevelRunMode", ",", "nil", "\n", "case", "string", "(", "ProductionRunMode", ")", ...
// StringToRunMode turns a string into a run-mode
[ "StringToRunMode", "turns", "a", "string", "into", "a", "run", "-", "mode" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/runmode.go#L11-L24
160,772
keybase/client
go/client/cmd_list_followers.go
ParseArgv
func (c *CmdListTrackers) ParseArgv(ctx *cli.Context) error { if len(ctx.Args()) == 1 { c.assertion = ctx.Args()[0] } c.verbose = ctx.Bool("verbose") return nil }
go
func (c *CmdListTrackers) ParseArgv(ctx *cli.Context) error { if len(ctx.Args()) == 1 { c.assertion = ctx.Args()[0] } c.verbose = ctx.Bool("verbose") return nil }
[ "func", "(", "c", "*", "CmdListTrackers", ")", "ParseArgv", "(", "ctx", "*", "cli", ".", "Context", ")", "error", "{", "if", "len", "(", "ctx", ".", "Args", "(", ")", ")", "==", "1", "{", "c", ".", "assertion", "=", "ctx", ".", "Args", "(", ")"...
// ParseArgv parses the command args.
[ "ParseArgv", "parses", "the", "command", "args", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_list_followers.go#L81-L88
160,773
keybase/client
go/client/cmd_list_followers.go
GetUsage
func (c *CmdListTrackers) GetUsage() libkb.Usage { return libkb.Usage{ Config: true, API: true, } }
go
func (c *CmdListTrackers) GetUsage() libkb.Usage { return libkb.Usage{ Config: true, API: true, } }
[ "func", "(", "c", "*", "CmdListTrackers", ")", "GetUsage", "(", ")", "libkb", ".", "Usage", "{", "return", "libkb", ".", "Usage", "{", "Config", ":", "true", ",", "API", ":", "true", ",", "}", "\n", "}" ]
// GetUsage says what this command needs to operate.
[ "GetUsage", "says", "what", "this", "command", "needs", "to", "operate", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_list_followers.go#L91-L96
160,774
keybase/client
go/libkb/keyring.go
LockedLocalSecretKey
func LockedLocalSecretKey(m MetaContext, ska SecretKeyArg) (*SKB, error) { var ret *SKB me := ska.Me keyring, err := m.Keyring() if err != nil { return nil, err } if keyring == nil { m.Debug("| No secret keyring found: %s", err) return nil, NoKeyringsError{} } ckf := me.GetComputedKeyFamily() if ckf ==...
go
func LockedLocalSecretKey(m MetaContext, ska SecretKeyArg) (*SKB, error) { var ret *SKB me := ska.Me keyring, err := m.Keyring() if err != nil { return nil, err } if keyring == nil { m.Debug("| No secret keyring found: %s", err) return nil, NoKeyringsError{} } ckf := me.GetComputedKeyFamily() if ckf ==...
[ "func", "LockedLocalSecretKey", "(", "m", "MetaContext", ",", "ska", "SecretKeyArg", ")", "(", "*", "SKB", ",", "error", ")", "{", "var", "ret", "*", "SKB", "\n", "me", ":=", "ska", ".", "Me", "\n\n", "keyring", ",", "err", ":=", "m", ".", "Keyring",...
// LockedLocalSecretKey looks in the local keyring to find a key // for the given user. Returns non-nil if one was found, and nil // otherwise.
[ "LockedLocalSecretKey", "looks", "in", "the", "local", "keyring", "to", "find", "a", "key", "for", "the", "given", "user", ".", "Returns", "non", "-", "nil", "if", "one", "was", "found", "and", "nil", "otherwise", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/keyring.go#L214-L264
160,775
keybase/client
go/libkb/keyring.go
GetSecretKeyLocked
func (k *Keyrings) GetSecretKeyLocked(m MetaContext, ska SecretKeyArg) (ret *SKB, err error) { defer m.Trace("Keyrings#GetSecretKeyLocked()", func() error { return err })() m.Debug("| LoadMe w/ Secrets on") if ska.Me == nil { if ska.Me, err = LoadMe(NewLoadUserArg(k.G())); err != nil { return nil, err } } ...
go
func (k *Keyrings) GetSecretKeyLocked(m MetaContext, ska SecretKeyArg) (ret *SKB, err error) { defer m.Trace("Keyrings#GetSecretKeyLocked()", func() error { return err })() m.Debug("| LoadMe w/ Secrets on") if ska.Me == nil { if ska.Me, err = LoadMe(NewLoadUserArg(k.G())); err != nil { return nil, err } } ...
[ "func", "(", "k", "*", "Keyrings", ")", "GetSecretKeyLocked", "(", "m", "MetaContext", ",", "ska", "SecretKeyArg", ")", "(", "ret", "*", "SKB", ",", "err", "error", ")", "{", "defer", "m", ".", "Trace", "(", "\"", "\"", ",", "func", "(", ")", "erro...
// GetSecretKeyLocked gets a secret key for the current user by first // looking for keys synced from the server, and if that fails, tries // those in the local Keyring that are also active for the user. // In any case, the key will be locked.
[ "GetSecretKeyLocked", "gets", "a", "secret", "key", "for", "the", "current", "user", "by", "first", "looking", "for", "keys", "synced", "from", "the", "server", "and", "if", "that", "fails", "tries", "those", "in", "the", "local", "Keyring", "that", "are", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/keyring.go#L270-L318
160,776
keybase/client
go/kbfs/libkbfs/shared_keybase_transport.go
NewSharedKeybaseConnection
func NewSharedKeybaseConnection(kbCtx Context, config Config, handler rpc.ConnectionHandler) *rpc.Connection { transport := &SharedKeybaseTransport{kbCtx: kbCtx} constBackoff := backoff.NewConstantBackOff(RPCReconnectInterval) opts := rpc.ConnectionOpts{ WrapErrorFunc: libkb.WrapError, TagsFunc: libk...
go
func NewSharedKeybaseConnection(kbCtx Context, config Config, handler rpc.ConnectionHandler) *rpc.Connection { transport := &SharedKeybaseTransport{kbCtx: kbCtx} constBackoff := backoff.NewConstantBackOff(RPCReconnectInterval) opts := rpc.ConnectionOpts{ WrapErrorFunc: libkb.WrapError, TagsFunc: libk...
[ "func", "NewSharedKeybaseConnection", "(", "kbCtx", "Context", ",", "config", "Config", ",", "handler", "rpc", ".", "ConnectionHandler", ")", "*", "rpc", ".", "Connection", "{", "transport", ":=", "&", "SharedKeybaseTransport", "{", "kbCtx", ":", "kbCtx", "}", ...
// NewSharedKeybaseConnection returns a connection that tries to // connect to the local keybase daemon.
[ "NewSharedKeybaseConnection", "returns", "a", "connection", "that", "tries", "to", "connect", "to", "the", "local", "keybase", "daemon", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/shared_keybase_transport.go#L19-L31
160,777
keybase/client
go/kbfs/libkbfs/shared_keybase_transport.go
Dial
func (kt *SharedKeybaseTransport) Dial(ctx context.Context) ( rpc.Transporter, error) { _, transport, _, err := kt.kbCtx.GetSocket(true) if err != nil { return nil, err } kt.mutex.Lock() defer kt.mutex.Unlock() kt.stagedTransport = transport return transport, nil }
go
func (kt *SharedKeybaseTransport) Dial(ctx context.Context) ( rpc.Transporter, error) { _, transport, _, err := kt.kbCtx.GetSocket(true) if err != nil { return nil, err } kt.mutex.Lock() defer kt.mutex.Unlock() kt.stagedTransport = transport return transport, nil }
[ "func", "(", "kt", "*", "SharedKeybaseTransport", ")", "Dial", "(", "ctx", "context", ".", "Context", ")", "(", "rpc", ".", "Transporter", ",", "error", ")", "{", "_", ",", "transport", ",", "_", ",", "err", ":=", "kt", ".", "kbCtx", ".", "GetSocket"...
// Dial is an implementation of the ConnectionTransport interface.
[ "Dial", "is", "an", "implementation", "of", "the", "ConnectionTransport", "interface", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/shared_keybase_transport.go#L49-L60
160,778
keybase/client
go/kbfs/libkbfs/shared_keybase_transport.go
IsConnected
func (kt *SharedKeybaseTransport) IsConnected() bool { kt.mutex.Lock() defer kt.mutex.Unlock() return kt.transport != nil && kt.transport.IsConnected() }
go
func (kt *SharedKeybaseTransport) IsConnected() bool { kt.mutex.Lock() defer kt.mutex.Unlock() return kt.transport != nil && kt.transport.IsConnected() }
[ "func", "(", "kt", "*", "SharedKeybaseTransport", ")", "IsConnected", "(", ")", "bool", "{", "kt", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "kt", ".", "mutex", ".", "Unlock", "(", ")", "\n", "return", "kt", ".", "transport", "!=", "nil", ...
// IsConnected is an implementation of the ConnectionTransport interface.
[ "IsConnected", "is", "an", "implementation", "of", "the", "ConnectionTransport", "interface", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/shared_keybase_transport.go#L63-L67
160,779
keybase/client
go/kbfs/libkbfs/shared_keybase_transport.go
Finalize
func (kt *SharedKeybaseTransport) Finalize() { kt.mutex.Lock() defer kt.mutex.Unlock() kt.transport = kt.stagedTransport kt.stagedTransport = nil }
go
func (kt *SharedKeybaseTransport) Finalize() { kt.mutex.Lock() defer kt.mutex.Unlock() kt.transport = kt.stagedTransport kt.stagedTransport = nil }
[ "func", "(", "kt", "*", "SharedKeybaseTransport", ")", "Finalize", "(", ")", "{", "kt", ".", "mutex", ".", "Lock", "(", ")", "\n", "defer", "kt", ".", "mutex", ".", "Unlock", "(", ")", "\n", "kt", ".", "transport", "=", "kt", ".", "stagedTransport", ...
// Finalize is an implementation of the ConnectionTransport interface.
[ "Finalize", "is", "an", "implementation", "of", "the", "ConnectionTransport", "interface", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/shared_keybase_transport.go#L70-L75
160,780
keybase/client
go/kbfs/libkbfs/md_ops.go
NewMDOpsStandard
func NewMDOpsStandard(config Config) *MDOpsStandard { log := config.MakeLogger("") return &MDOpsStandard{ config: config, log: log, vlog: config.MakeVLogger(log), leafChainsValidated: make( map[tlf.ID]map[kbfsmd.Revision]kbfsmd.Revision), } }
go
func NewMDOpsStandard(config Config) *MDOpsStandard { log := config.MakeLogger("") return &MDOpsStandard{ config: config, log: log, vlog: config.MakeVLogger(log), leafChainsValidated: make( map[tlf.ID]map[kbfsmd.Revision]kbfsmd.Revision), } }
[ "func", "NewMDOpsStandard", "(", "config", "Config", ")", "*", "MDOpsStandard", "{", "log", ":=", "config", ".", "MakeLogger", "(", "\"", "\"", ")", "\n", "return", "&", "MDOpsStandard", "{", "config", ":", "config", ",", "log", ":", "log", ",", "vlog", ...
// NewMDOpsStandard returns a new MDOpsStandard
[ "NewMDOpsStandard", "returns", "a", "new", "MDOpsStandard" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L74-L83
160,781
keybase/client
go/kbfs/libkbfs/md_ops.go
convertVerifyingKeyError
func (md *MDOpsStandard) convertVerifyingKeyError(ctx context.Context, rmds *RootMetadataSigned, handle *tlfhandle.Handle, err error) error { if _, ok := err.(VerifyingKeyNotFoundError); !ok { return err } tlf := handle.GetCanonicalPath() writer, nameErr := md.config.KBPKI().GetNormalizedUsername( ctx, rmds.M...
go
func (md *MDOpsStandard) convertVerifyingKeyError(ctx context.Context, rmds *RootMetadataSigned, handle *tlfhandle.Handle, err error) error { if _, ok := err.(VerifyingKeyNotFoundError); !ok { return err } tlf := handle.GetCanonicalPath() writer, nameErr := md.config.KBPKI().GetNormalizedUsername( ctx, rmds.M...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "convertVerifyingKeyError", "(", "ctx", "context", ".", "Context", ",", "rmds", "*", "RootMetadataSigned", ",", "handle", "*", "tlfhandle", ".", "Handle", ",", "err", "error", ")", "error", "{", "if", "_", ",",...
// convertVerifyingKeyError gives a better error when the TLF was // signed by a key that is no longer associated with the last writer.
[ "convertVerifyingKeyError", "gives", "a", "better", "error", "when", "the", "TLF", "was", "signed", "by", "a", "key", "that", "is", "no", "longer", "associated", "with", "the", "last", "writer", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L87-L104
160,782
keybase/client
go/kbfs/libkbfs/md_ops.go
startOfValidatedChainForLeaf
func (md *MDOpsStandard) startOfValidatedChainForLeaf( tlfID tlf.ID, leafRev kbfsmd.Revision) kbfsmd.Revision { md.lock.Lock() defer md.lock.Unlock() revs, ok := md.leafChainsValidated[tlfID] if !ok { return leafRev } min, ok := revs[leafRev] if !ok { return leafRev } return min }
go
func (md *MDOpsStandard) startOfValidatedChainForLeaf( tlfID tlf.ID, leafRev kbfsmd.Revision) kbfsmd.Revision { md.lock.Lock() defer md.lock.Unlock() revs, ok := md.leafChainsValidated[tlfID] if !ok { return leafRev } min, ok := revs[leafRev] if !ok { return leafRev } return min }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "startOfValidatedChainForLeaf", "(", "tlfID", "tlf", ".", "ID", ",", "leafRev", "kbfsmd", ".", "Revision", ")", "kbfsmd", ".", "Revision", "{", "md", ".", "lock", ".", "Lock", "(", ")", "\n", "defer", "md", ...
// startOfValidatedChainForLeaf returns the earliest revision in the // chain leading up to `leafRev` that's been validated so far. If no // validations have occurred yet, it returns `leafRev`.
[ "startOfValidatedChainForLeaf", "returns", "the", "earliest", "revision", "in", "the", "chain", "leading", "up", "to", "leafRev", "that", "s", "been", "validated", "so", "far", ".", "If", "no", "validations", "have", "occurred", "yet", "it", "returns", "leafRev"...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L334-L347
160,783
keybase/client
go/kbfs/libkbfs/md_ops.go
GetIDForHandle
func (md *MDOpsStandard) GetIDForHandle( ctx context.Context, handle *tlfhandle.Handle) (id tlf.ID, err error) { mdcache := md.config.MDCache() id, err = mdcache.GetIDForHandle(handle) switch errors.Cause(err).(type) { case NoSuchTlfIDError: // Do the server-based lookup below. case nil: return id, nil defau...
go
func (md *MDOpsStandard) GetIDForHandle( ctx context.Context, handle *tlfhandle.Handle) (id tlf.ID, err error) { mdcache := md.config.MDCache() id, err = mdcache.GetIDForHandle(handle) switch errors.Cause(err).(type) { case NoSuchTlfIDError: // Do the server-based lookup below. case nil: return id, nil defau...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetIDForHandle", "(", "ctx", "context", ".", "Context", ",", "handle", "*", "tlfhandle", ".", "Handle", ")", "(", "id", "tlf", ".", "ID", ",", "err", "error", ")", "{", "mdcache", ":=", "md", ".", "confi...
// GetIDForHandle implements the MDOps interface for MDOpsStandard.
[ "GetIDForHandle", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L988-L1014
160,784
keybase/client
go/kbfs/libkbfs/md_ops.go
GetForTLF
func (md *MDOpsStandard) GetForTLF( ctx context.Context, id tlf.ID, lockBeforeGet *keybase1.LockID) ( ImmutableRootMetadata, error) { return md.getForTLF(ctx, id, kbfsmd.NullBranchID, kbfsmd.Merged, lockBeforeGet) }
go
func (md *MDOpsStandard) GetForTLF( ctx context.Context, id tlf.ID, lockBeforeGet *keybase1.LockID) ( ImmutableRootMetadata, error) { return md.getForTLF(ctx, id, kbfsmd.NullBranchID, kbfsmd.Merged, lockBeforeGet) }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetForTLF", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "lockBeforeGet", "*", "keybase1", ".", "LockID", ")", "(", "ImmutableRootMetadata", ",", "error", ")", "{", "return", "md"...
// GetForTLF implements the MDOps interface for MDOpsStandard.
[ "GetForTLF", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1083-L1087
160,785
keybase/client
go/kbfs/libkbfs/md_ops.go
GetForTLFByTime
func (md *MDOpsStandard) GetForTLFByTime( ctx context.Context, id tlf.ID, serverTime time.Time) ( irmd ImmutableRootMetadata, err error) { md.log.CDebugf(ctx, "GetForTLFByTime %s %s", id, serverTime) defer func() { if err == nil { md.log.CDebugf(ctx, "GetForTLFByTime %s %s done: %d", id, serverTime, irmd.R...
go
func (md *MDOpsStandard) GetForTLFByTime( ctx context.Context, id tlf.ID, serverTime time.Time) ( irmd ImmutableRootMetadata, err error) { md.log.CDebugf(ctx, "GetForTLFByTime %s %s", id, serverTime) defer func() { if err == nil { md.log.CDebugf(ctx, "GetForTLFByTime %s %s done: %d", id, serverTime, irmd.R...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetForTLFByTime", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "serverTime", "time", ".", "Time", ")", "(", "irmd", "ImmutableRootMetadata", ",", "err", "error", ")", "{", "md", ...
// GetForTLFByTime implements the MDOps interface for MDOpsStandard.
[ "GetForTLFByTime", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1090-L1113
160,786
keybase/client
go/kbfs/libkbfs/md_ops.go
GetUnmergedForTLF
func (md *MDOpsStandard) GetUnmergedForTLF( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID) ( ImmutableRootMetadata, error) { return md.getForTLF(ctx, id, bid, kbfsmd.Unmerged, nil) }
go
func (md *MDOpsStandard) GetUnmergedForTLF( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID) ( ImmutableRootMetadata, error) { return md.getForTLF(ctx, id, bid, kbfsmd.Unmerged, nil) }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetUnmergedForTLF", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "bid", "kbfsmd", ".", "BranchID", ")", "(", "ImmutableRootMetadata", ",", "error", ")", "{", "return", "md", ".", ...
// GetUnmergedForTLF implements the MDOps interface for MDOpsStandard.
[ "GetUnmergedForTLF", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1116-L1120
160,787
keybase/client
go/kbfs/libkbfs/md_ops.go
GetRange
func (md *MDOpsStandard) GetRange(ctx context.Context, id tlf.ID, start, stop kbfsmd.Revision, lockBeforeGet *keybase1.LockID) ( []ImmutableRootMetadata, error) { return md.getRange( ctx, id, kbfsmd.NullBranchID, kbfsmd.Merged, start, stop, lockBeforeGet) }
go
func (md *MDOpsStandard) GetRange(ctx context.Context, id tlf.ID, start, stop kbfsmd.Revision, lockBeforeGet *keybase1.LockID) ( []ImmutableRootMetadata, error) { return md.getRange( ctx, id, kbfsmd.NullBranchID, kbfsmd.Merged, start, stop, lockBeforeGet) }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetRange", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "start", ",", "stop", "kbfsmd", ".", "Revision", ",", "lockBeforeGet", "*", "keybase1", ".", "LockID", ")", "(", "[", "...
// GetRange implements the MDOps interface for MDOpsStandard.
[ "GetRange", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1249-L1254
160,788
keybase/client
go/kbfs/libkbfs/md_ops.go
GetUnmergedRange
func (md *MDOpsStandard) GetUnmergedRange(ctx context.Context, id tlf.ID, bid kbfsmd.BranchID, start, stop kbfsmd.Revision) ( []ImmutableRootMetadata, error) { return md.getRange(ctx, id, bid, kbfsmd.Unmerged, start, stop, nil) }
go
func (md *MDOpsStandard) GetUnmergedRange(ctx context.Context, id tlf.ID, bid kbfsmd.BranchID, start, stop kbfsmd.Revision) ( []ImmutableRootMetadata, error) { return md.getRange(ctx, id, bid, kbfsmd.Unmerged, start, stop, nil) }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "GetUnmergedRange", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "bid", "kbfsmd", ".", "BranchID", ",", "start", ",", "stop", "kbfsmd", ".", "Revision", ")", "(", "[", "]", "Im...
// GetUnmergedRange implements the MDOps interface for MDOpsStandard.
[ "GetUnmergedRange", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1257-L1261
160,789
keybase/client
go/kbfs/libkbfs/md_ops.go
Put
func (md *MDOpsStandard) Put(ctx context.Context, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey, lockContext *keybase1.LockContext, priority keybase1.MDPriority) (ImmutableRootMetadata, error) { if rmd.MergedStatus() == kbfsmd.Unmerged { return ImmutableRootMetadata{}, UnexpectedUnmergedPutError{} } re...
go
func (md *MDOpsStandard) Put(ctx context.Context, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey, lockContext *keybase1.LockContext, priority keybase1.MDPriority) (ImmutableRootMetadata, error) { if rmd.MergedStatus() == kbfsmd.Unmerged { return ImmutableRootMetadata{}, UnexpectedUnmergedPutError{} } re...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "Put", "(", "ctx", "context", ".", "Context", ",", "rmd", "*", "RootMetadata", ",", "verifyingKey", "kbfscrypto", ".", "VerifyingKey", ",", "lockContext", "*", "keybase1", ".", "LockContext", ",", "priority", "ke...
// Put implements the MDOps interface for MDOpsStandard.
[ "Put", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1322-L1329
160,790
keybase/client
go/kbfs/libkbfs/md_ops.go
PutUnmerged
func (md *MDOpsStandard) PutUnmerged( ctx context.Context, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey) (ImmutableRootMetadata, error) { rmd.SetUnmerged() if rmd.BID() == kbfsmd.NullBranchID { // new branch ID bid, err := md.config.Crypto().MakeRandomBranchID() if err != nil { return ImmutableR...
go
func (md *MDOpsStandard) PutUnmerged( ctx context.Context, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey) (ImmutableRootMetadata, error) { rmd.SetUnmerged() if rmd.BID() == kbfsmd.NullBranchID { // new branch ID bid, err := md.config.Crypto().MakeRandomBranchID() if err != nil { return ImmutableR...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "PutUnmerged", "(", "ctx", "context", ".", "Context", ",", "rmd", "*", "RootMetadata", ",", "verifyingKey", "kbfscrypto", ".", "VerifyingKey", ")", "(", "ImmutableRootMetadata", ",", "error", ")", "{", "rmd", "."...
// PutUnmerged implements the MDOps interface for MDOpsStandard.
[ "PutUnmerged", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1332-L1345
160,791
keybase/client
go/kbfs/libkbfs/md_ops.go
PruneBranch
func (md *MDOpsStandard) PruneBranch( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID) error { mdserv, err := md.mdserver(ctx) if err != nil { return err } return mdserv.PruneBranch(ctx, id, bid) }
go
func (md *MDOpsStandard) PruneBranch( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID) error { mdserv, err := md.mdserver(ctx) if err != nil { return err } return mdserv.PruneBranch(ctx, id, bid) }
[ "func", "(", "md", "*", "MDOpsStandard", ")", "PruneBranch", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "bid", "kbfsmd", ".", "BranchID", ")", "error", "{", "mdserv", ",", "err", ":=", "md", ".", "mdserver", "(", "ctx", ...
// PruneBranch implements the MDOps interface for MDOpsStandard.
[ "PruneBranch", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1348-L1355
160,792
keybase/client
go/kbfs/libkbfs/md_ops.go
ResolveBranch
func (md *MDOpsStandard) ResolveBranch( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID, _ []kbfsblock.ID, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey) ( ImmutableRootMetadata, error) { // Put the MD first. irmd, err := md.Put(ctx, rmd, verifyingKey, nil, keybase1.MDPriorityNormal) if err != nil {...
go
func (md *MDOpsStandard) ResolveBranch( ctx context.Context, id tlf.ID, bid kbfsmd.BranchID, _ []kbfsblock.ID, rmd *RootMetadata, verifyingKey kbfscrypto.VerifyingKey) ( ImmutableRootMetadata, error) { // Put the MD first. irmd, err := md.Put(ctx, rmd, verifyingKey, nil, keybase1.MDPriorityNormal) if err != nil {...
[ "func", "(", "md", "*", "MDOpsStandard", ")", "ResolveBranch", "(", "ctx", "context", ".", "Context", ",", "id", "tlf", ".", "ID", ",", "bid", "kbfsmd", ".", "BranchID", ",", "_", "[", "]", "kbfsblock", ".", "ID", ",", "rmd", "*", "RootMetadata", ","...
// ResolveBranch implements the MDOps interface for MDOpsStandard.
[ "ResolveBranch", "implements", "the", "MDOps", "interface", "for", "MDOpsStandard", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_ops.go#L1358-L1376
160,793
keybase/client
go/engine/pgp_common.go
OutputSignatureSuccess
func OutputSignatureSuccess(m libkb.MetaContext, fingerprint libkb.PGPFingerprint, owner *libkb.User, signatureTime time.Time) error { arg := keybase1.OutputSignatureSuccessArg{ Fingerprint: fingerprint.String(), Username: owner.GetName(), SignedAt: keybase1.TimeFromSeconds(signatureTime.Unix()), } retur...
go
func OutputSignatureSuccess(m libkb.MetaContext, fingerprint libkb.PGPFingerprint, owner *libkb.User, signatureTime time.Time) error { arg := keybase1.OutputSignatureSuccessArg{ Fingerprint: fingerprint.String(), Username: owner.GetName(), SignedAt: keybase1.TimeFromSeconds(signatureTime.Unix()), } retur...
[ "func", "OutputSignatureSuccess", "(", "m", "libkb", ".", "MetaContext", ",", "fingerprint", "libkb", ".", "PGPFingerprint", ",", "owner", "*", "libkb", ".", "User", ",", "signatureTime", "time", ".", "Time", ")", "error", "{", "arg", ":=", "keybase1", ".", ...
// OutputSignatureSuccess prints the details of a successful verification.
[ "OutputSignatureSuccess", "prints", "the", "details", "of", "a", "successful", "verification", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_common.go#L15-L22
160,794
keybase/client
go/engine/pgp_common.go
OutputSignatureSuccessNonKeybase
func OutputSignatureSuccessNonKeybase(m libkb.MetaContext, keyID uint64, signatureTime time.Time) error { arg := keybase1.OutputSignatureSuccessNonKeybaseArg{ KeyID: fmt.Sprintf("%X", keyID), SignedAt: keybase1.TimeFromSeconds(signatureTime.Unix()), } return m.UIs().PgpUI.OutputSignatureSuccessNonKeybase(m.Ct...
go
func OutputSignatureSuccessNonKeybase(m libkb.MetaContext, keyID uint64, signatureTime time.Time) error { arg := keybase1.OutputSignatureSuccessNonKeybaseArg{ KeyID: fmt.Sprintf("%X", keyID), SignedAt: keybase1.TimeFromSeconds(signatureTime.Unix()), } return m.UIs().PgpUI.OutputSignatureSuccessNonKeybase(m.Ct...
[ "func", "OutputSignatureSuccessNonKeybase", "(", "m", "libkb", ".", "MetaContext", ",", "keyID", "uint64", ",", "signatureTime", "time", ".", "Time", ")", "error", "{", "arg", ":=", "keybase1", ".", "OutputSignatureSuccessNonKeybaseArg", "{", "KeyID", ":", "fmt", ...
// OutputSignatureSuccessNonKeybase prints the details of successful signature verification // when signing key is not known to keybase.
[ "OutputSignatureSuccessNonKeybase", "prints", "the", "details", "of", "successful", "signature", "verification", "when", "signing", "key", "is", "not", "known", "to", "keybase", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_common.go#L26-L32
160,795
keybase/client
go/engine/wallet_upkeep_background.go
NewWalletUpkeepBackground
func NewWalletUpkeepBackground(g *libkb.GlobalContext, args *WalletUpkeepBackgroundArgs) *WalletUpkeepBackground { task := NewBackgroundTask(g, &BackgroundTaskArgs{ Name: "WalletUpkeepBackground", F: WalletUpkeepBackgroundRound, Settings: WalletUpkeepBackgroundSettings, testingMetaCh: args.test...
go
func NewWalletUpkeepBackground(g *libkb.GlobalContext, args *WalletUpkeepBackgroundArgs) *WalletUpkeepBackground { task := NewBackgroundTask(g, &BackgroundTaskArgs{ Name: "WalletUpkeepBackground", F: WalletUpkeepBackgroundRound, Settings: WalletUpkeepBackgroundSettings, testingMetaCh: args.test...
[ "func", "NewWalletUpkeepBackground", "(", "g", "*", "libkb", ".", "GlobalContext", ",", "args", "*", "WalletUpkeepBackgroundArgs", ")", "*", "WalletUpkeepBackground", "{", "task", ":=", "NewBackgroundTask", "(", "g", ",", "&", "BackgroundTaskArgs", "{", "Name", ":...
// NewWalletUpkeepBackground creates a WalletUpkeepBackground engine.
[ "NewWalletUpkeepBackground", "creates", "a", "WalletUpkeepBackground", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/wallet_upkeep_background.go#L39-L54
160,796
keybase/client
go/chat/boxer.go
UnboxThread
func (b *Boxer) UnboxThread(ctx context.Context, boxed chat1.ThreadViewBoxed, conv types.UnboxConversationInfo) (thread chat1.ThreadView, err error) { thread = chat1.ThreadView{ Pagination: boxed.Pagination, } if thread.Messages, err = b.UnboxMessages(ctx, boxed.Messages, conv); err != nil { return chat1.Threa...
go
func (b *Boxer) UnboxThread(ctx context.Context, boxed chat1.ThreadViewBoxed, conv types.UnboxConversationInfo) (thread chat1.ThreadView, err error) { thread = chat1.ThreadView{ Pagination: boxed.Pagination, } if thread.Messages, err = b.UnboxMessages(ctx, boxed.Messages, conv); err != nil { return chat1.Threa...
[ "func", "(", "b", "*", "Boxer", ")", "UnboxThread", "(", "ctx", "context", ".", "Context", ",", "boxed", "chat1", ".", "ThreadViewBoxed", ",", "conv", "types", ".", "UnboxConversationInfo", ")", "(", "thread", "chat1", ".", "ThreadView", ",", "err", "error...
// unboxThread transforms a chat1.ThreadViewBoxed to a keybase1.ThreadView.
[ "unboxThread", "transforms", "a", "chat1", ".", "ThreadViewBoxed", "to", "a", "keybase1", ".", "ThreadView", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/boxer.go#L1114-L1125
160,797
keybase/client
go/chat/boxer.go
dummySigningKey
func dummySigningKey() libkb.NaclSigningKeyPair { dummySigningKeyOnce.Do(func() { var allZeroSecretKey [libkb.NaclSigningKeySecretSize]byte dummyKeypair, err := libkb.MakeNaclSigningKeyPairFromSecret(allZeroSecretKey) if err != nil { panic("errors in key generation should be impossible: " + err.Error()) } ...
go
func dummySigningKey() libkb.NaclSigningKeyPair { dummySigningKeyOnce.Do(func() { var allZeroSecretKey [libkb.NaclSigningKeySecretSize]byte dummyKeypair, err := libkb.MakeNaclSigningKeyPairFromSecret(allZeroSecretKey) if err != nil { panic("errors in key generation should be impossible: " + err.Error()) } ...
[ "func", "dummySigningKey", "(", ")", "libkb", ".", "NaclSigningKeyPair", "{", "dummySigningKeyOnce", ".", "Do", "(", "func", "(", ")", "{", "var", "allZeroSecretKey", "[", "libkb", ".", "NaclSigningKeySecretSize", "]", "byte", "\n", "dummyKeypair", ",", "err", ...
// We use this constant key when we already have pairwiseMACs providing // authentication. Creating a keypair requires a curve multiply, so we cache it // here, in case someone uses it in a tight loop.
[ "We", "use", "this", "constant", "key", "when", "we", "already", "have", "pairwiseMACs", "providing", "authentication", ".", "Creating", "a", "keypair", "requires", "a", "curve", "multiply", "so", "we", "cache", "it", "here", "in", "case", "someone", "uses", ...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/boxer.go#L1289-L1299
160,798
keybase/client
go/chat/boxer.go
BoxMessage
func (b *Boxer) BoxMessage(ctx context.Context, msg chat1.MessagePlaintext, membersType chat1.ConversationMembersType, signingKeyPair libkb.NaclSigningKeyPair, info *types.BoxerEncryptionInfo) (res chat1.MessageBoxed, err error) { defer b.Trace(ctx, func() error { return err }, "BoxMessage")() tlfName := msg.Client...
go
func (b *Boxer) BoxMessage(ctx context.Context, msg chat1.MessagePlaintext, membersType chat1.ConversationMembersType, signingKeyPair libkb.NaclSigningKeyPair, info *types.BoxerEncryptionInfo) (res chat1.MessageBoxed, err error) { defer b.Trace(ctx, func() error { return err }, "BoxMessage")() tlfName := msg.Client...
[ "func", "(", "b", "*", "Boxer", ")", "BoxMessage", "(", "ctx", "context", ".", "Context", ",", "msg", "chat1", ".", "MessagePlaintext", ",", "membersType", "chat1", ".", "ConversationMembersType", ",", "signingKeyPair", "libkb", ".", "NaclSigningKeyPair", ",", ...
// BoxMessage encrypts a keybase1.MessagePlaintext into a chat1.MessageBoxed. It // finds the most recent key for the TLF.
[ "BoxMessage", "encrypts", "a", "keybase1", ".", "MessagePlaintext", "into", "a", "chat1", ".", "MessageBoxed", ".", "It", "finds", "the", "most", "recent", "key", "for", "the", "TLF", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/boxer.go#L1394-L1426
160,799
keybase/client
go/chat/boxer.go
attachMerkleRoot
func (b *Boxer) attachMerkleRoot(ctx context.Context, msg *chat1.MessagePlaintext, version chat1.MessageBoxedVersion) error { switch version { case chat1.MessageBoxedVersion_V1: if msg.ClientHeader.MerkleRoot != nil { return NewBoxingError("cannot send v1 message with merkle root", true) } case chat1.MessageB...
go
func (b *Boxer) attachMerkleRoot(ctx context.Context, msg *chat1.MessagePlaintext, version chat1.MessageBoxedVersion) error { switch version { case chat1.MessageBoxedVersion_V1: if msg.ClientHeader.MerkleRoot != nil { return NewBoxingError("cannot send v1 message with merkle root", true) } case chat1.MessageB...
[ "func", "(", "b", "*", "Boxer", ")", "attachMerkleRoot", "(", "ctx", "context", ".", "Context", ",", "msg", "*", "chat1", ".", "MessagePlaintext", ",", "version", "chat1", ".", "MessageBoxedVersion", ")", "error", "{", "switch", "version", "{", "case", "ch...
// Attach a merkle root to the message to send. // Modifies msg. // For MessageBoxedV1 makes sure there is no MR. // For MessageBoxedV2 attaches a MR that is no more out of date than ChatBoxerMerkleFreshness.
[ "Attach", "a", "merkle", "root", "to", "the", "message", "to", "send", ".", "Modifies", "msg", ".", "For", "MessageBoxedV1", "makes", "sure", "there", "is", "no", "MR", ".", "For", "MessageBoxedV2", "attaches", "a", "MR", "that", "is", "no", "more", "out...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/boxer.go#L1432-L1451