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
158,900
keybase/client
go/tools/runquiet/runquiet.go
doRun
func doRun(elevated bool) error { argsIndex := 1 // 0 is the name of this program, 1 is either the one to launch or the "wait" option if len(os.Args) < 2 { log.Fatal("ERROR: no arguments. Use [-wait] programname [arg arg arg]\n") } // Do this awkward thing so we can pass along the rest of the command line as-is...
go
func doRun(elevated bool) error { argsIndex := 1 // 0 is the name of this program, 1 is either the one to launch or the "wait" option if len(os.Args) < 2 { log.Fatal("ERROR: no arguments. Use [-wait] programname [arg arg arg]\n") } // Do this awkward thing so we can pass along the rest of the command line as-is...
[ "func", "doRun", "(", "elevated", "bool", ")", "error", "{", "argsIndex", ":=", "1", "// 0 is the name of this program, 1 is either the one to launch or the \"wait\" option", "\n\n", "if", "len", "(", "os", ".", "Args", ")", "<", "2", "{", "log", ".", "Fatal", "("...
// elevated means we try running as user
[ "elevated", "means", "we", "try", "running", "as", "user" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/tools/runquiet/runquiet.go#L169-L248
158,901
keybase/client
go/kbfs/libgit/git_config_without_remotes_storer.go
NewGitConfigWithoutRemotesStorer
func NewGitConfigWithoutRemotesStorer(fs *libfs.FS) ( *GitConfigWithoutRemotesStorer, error) { fsStorer, err := filesystem.NewStorage(fs) if err != nil { return nil, err } cfg, err := fsStorer.Config() if err != nil { return nil, err } // To figure out if this config has been written already, check if // i...
go
func NewGitConfigWithoutRemotesStorer(fs *libfs.FS) ( *GitConfigWithoutRemotesStorer, error) { fsStorer, err := filesystem.NewStorage(fs) if err != nil { return nil, err } cfg, err := fsStorer.Config() if err != nil { return nil, err } // To figure out if this config has been written already, check if // i...
[ "func", "NewGitConfigWithoutRemotesStorer", "(", "fs", "*", "libfs", ".", "FS", ")", "(", "*", "GitConfigWithoutRemotesStorer", ",", "error", ")", "{", "fsStorer", ",", "err", ":=", "filesystem", ".", "NewStorage", "(", "fs", ")", "\n", "if", "err", "!=", ...
// NewGitConfigWithoutRemotesStorer creates a new git config // implementation that strips remotes from the config before writing // them to disk.
[ "NewGitConfigWithoutRemotesStorer", "creates", "a", "new", "git", "config", "implementation", "that", "strips", "remotes", "from", "the", "config", "before", "writing", "them", "to", "disk", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/git_config_without_remotes_storer.go#L29-L47
158,902
keybase/client
go/kbfs/libgit/git_config_without_remotes_storer.go
SetConfig
func (cwrs *GitConfigWithoutRemotesStorer) SetConfig(c *gogitcfg.Config) ( err error) { if cwrs.stored && c.Core == cwrs.cfg.Core { // Ignore any change that doesn't change the core we know // about, to avoid attempting to write config files with // read-only access. return nil } defer func() { if err !=...
go
func (cwrs *GitConfigWithoutRemotesStorer) SetConfig(c *gogitcfg.Config) ( err error) { if cwrs.stored && c.Core == cwrs.cfg.Core { // Ignore any change that doesn't change the core we know // about, to avoid attempting to write config files with // read-only access. return nil } defer func() { if err !=...
[ "func", "(", "cwrs", "*", "GitConfigWithoutRemotesStorer", ")", "SetConfig", "(", "c", "*", "gogitcfg", ".", "Config", ")", "(", "err", "error", ")", "{", "if", "cwrs", ".", "stored", "&&", "c", ".", "Core", "==", "cwrs", ".", "cfg", ".", "Core", "{"...
// SetConfig implements the `storer.Storer` interface.
[ "SetConfig", "implements", "the", "storer", ".", "Storer", "interface", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/git_config_without_remotes_storer.go#L60-L102
158,903
keybase/client
go/teams/member_set.go
AddRemainingRecipients
func (m *memberSet) AddRemainingRecipients(ctx context.Context, g *libkb.GlobalContext, existing keybase1.TeamMembers) (err error) { defer g.CTrace(ctx, "memberSet#AddRemainingRecipients", func() error { return err })() // make a map of the None members noneMap := make(map[keybase1.UserVersion]bool) for _, n := r...
go
func (m *memberSet) AddRemainingRecipients(ctx context.Context, g *libkb.GlobalContext, existing keybase1.TeamMembers) (err error) { defer g.CTrace(ctx, "memberSet#AddRemainingRecipients", func() error { return err })() // make a map of the None members noneMap := make(map[keybase1.UserVersion]bool) for _, n := r...
[ "func", "(", "m", "*", "memberSet", ")", "AddRemainingRecipients", "(", "ctx", "context", ".", "Context", ",", "g", "*", "libkb", ".", "GlobalContext", ",", "existing", "keybase1", ".", "TeamMembers", ")", "(", "err", "error", ")", "{", "defer", "g", "."...
// AddRemainingRecipients adds everyone in existing to m.recipients that isn't in m.None.
[ "AddRemainingRecipients", "adds", "everyone", "in", "existing", "to", "m", ".", "recipients", "that", "isn", "t", "in", "m", ".", "None", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/member_set.go#L231-L264
158,904
keybase/client
go/teams/member_set.go
Section
func (m *memberSet) Section() (res *SCTeamMembers, err error) { if m.empty() { return nil, nil } res = &SCTeamMembers{} res.Owners, err = m.nameSeqList(m.Owners) if err != nil { return nil, err } res.Admins, err = m.nameSeqList(m.Admins) if err != nil { return nil, err } res.Writers, err = m.nameSeqLis...
go
func (m *memberSet) Section() (res *SCTeamMembers, err error) { if m.empty() { return nil, nil } res = &SCTeamMembers{} res.Owners, err = m.nameSeqList(m.Owners) if err != nil { return nil, err } res.Admins, err = m.nameSeqList(m.Admins) if err != nil { return nil, err } res.Writers, err = m.nameSeqLis...
[ "func", "(", "m", "*", "memberSet", ")", "Section", "(", ")", "(", "res", "*", "SCTeamMembers", ",", "err", "error", ")", "{", "if", "m", ".", "empty", "(", ")", "{", "return", "nil", ",", "nil", "\n", "}", "\n\n", "res", "=", "&", "SCTeamMembers...
// can return nil
[ "can", "return", "nil" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/member_set.go#L278-L305
158,905
keybase/client
go/kbfs/libkbfs/init.go
defaultBServer
func defaultBServer(ctx Context) string { switch ctx.GetRunMode() { case kbconst.DevelRunMode: return memoryAddr case kbconst.StagingRunMode: return ` bserver-0.dev.keybase.io:443,bserver-1.dev.keybase.io:443` case kbconst.ProductionRunMode: return ` bserver-0.kbfs.keybaseapi.com:443,bserver-1.kbfs.keyb...
go
func defaultBServer(ctx Context) string { switch ctx.GetRunMode() { case kbconst.DevelRunMode: return memoryAddr case kbconst.StagingRunMode: return ` bserver-0.dev.keybase.io:443,bserver-1.dev.keybase.io:443` case kbconst.ProductionRunMode: return ` bserver-0.kbfs.keybaseapi.com:443,bserver-1.kbfs.keyb...
[ "func", "defaultBServer", "(", "ctx", "Context", ")", "string", "{", "switch", "ctx", ".", "GetRunMode", "(", ")", "{", "case", "kbconst", ".", "DevelRunMode", ":", "return", "memoryAddr", "\n", "case", "kbconst", ".", "StagingRunMode", ":", "return", "`\n\t...
// defaultBServer returns the default value for the -bserver flag.
[ "defaultBServer", "returns", "the", "default", "value", "for", "the", "-", "bserver", "flag", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L154-L168
158,906
keybase/client
go/kbfs/libkbfs/init.go
defaultMetadataVersion
func defaultMetadataVersion(ctx Context) kbfsmd.MetadataVer { switch ctx.GetRunMode() { case kbconst.DevelRunMode: return kbfsmd.ImplicitTeamsVer case kbconst.StagingRunMode: return kbfsmd.ImplicitTeamsVer case kbconst.ProductionRunMode: return kbfsmd.ImplicitTeamsVer default: return kbfsmd.ImplicitTeamsVe...
go
func defaultMetadataVersion(ctx Context) kbfsmd.MetadataVer { switch ctx.GetRunMode() { case kbconst.DevelRunMode: return kbfsmd.ImplicitTeamsVer case kbconst.StagingRunMode: return kbfsmd.ImplicitTeamsVer case kbconst.ProductionRunMode: return kbfsmd.ImplicitTeamsVer default: return kbfsmd.ImplicitTeamsVe...
[ "func", "defaultMetadataVersion", "(", "ctx", "Context", ")", "kbfsmd", ".", "MetadataVer", "{", "switch", "ctx", ".", "GetRunMode", "(", ")", "{", "case", "kbconst", ".", "DevelRunMode", ":", "return", "kbfsmd", ".", "ImplicitTeamsVer", "\n", "case", "kbconst...
// defaultMetadataVersion returns the default metadata version per run mode.
[ "defaultMetadataVersion", "returns", "the", "default", "metadata", "version", "per", "run", "mode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L188-L199
158,907
keybase/client
go/kbfs/libkbfs/init.go
DefaultInitParams
func DefaultInitParams(ctx Context) InitParams { journalEnv := os.Getenv("KBFS_DEFAULT_ENABLE_JOURNAL_VALUE") if journalEnv == "" { journalEnv = "true" } return InitParams{ Debug: BoolForString(os.Getenv("KBFS_DEBUG")), BServerAddr: defaultBServer(ctx), MDServerAddr: defaultMDServer(c...
go
func DefaultInitParams(ctx Context) InitParams { journalEnv := os.Getenv("KBFS_DEFAULT_ENABLE_JOURNAL_VALUE") if journalEnv == "" { journalEnv = "true" } return InitParams{ Debug: BoolForString(os.Getenv("KBFS_DEBUG")), BServerAddr: defaultBServer(ctx), MDServerAddr: defaultMDServer(c...
[ "func", "DefaultInitParams", "(", "ctx", "Context", ")", "InitParams", "{", "journalEnv", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", "\n", "if", "journalEnv", "==", "\"", "\"", "{", "journalEnv", "=", "\"", "\"", "\n", "}", "\n", "return", "InitP...
// DefaultInitParams returns default init params
[ "DefaultInitParams", "returns", "default", "init", "params" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L206-L233
158,908
keybase/client
go/kbfs/libkbfs/init.go
AddFlags
func AddFlags(flags *flag.FlagSet, ctx Context) *InitParams { return AddFlagsWithDefaults( flags, DefaultInitParams(ctx), defaultLogPath(ctx)) }
go
func AddFlags(flags *flag.FlagSet, ctx Context) *InitParams { return AddFlagsWithDefaults( flags, DefaultInitParams(ctx), defaultLogPath(ctx)) }
[ "func", "AddFlags", "(", "flags", "*", "flag", ".", "FlagSet", ",", "ctx", "Context", ")", "*", "InitParams", "{", "return", "AddFlagsWithDefaults", "(", "flags", ",", "DefaultInitParams", "(", "ctx", ")", ",", "defaultLogPath", "(", "ctx", ")", ")", "\n",...
// AddFlags adds libkbfs flags to the given FlagSet. Returns an // InitParams that will be filled in once the given FlagSet is parsed.
[ "AddFlags", "adds", "libkbfs", "flags", "to", "the", "given", "FlagSet", ".", "Returns", "an", "InitParams", "that", "will", "be", "filled", "in", "once", "the", "given", "FlagSet", "is", "parsed", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L328-L331
158,909
keybase/client
go/kbfs/libkbfs/init.go
GetDefaultsUsageString
func GetDefaultsUsageString(ctx Context) string { runMode := ctx.GetRunMode() defaultBServer := defaultBServer(ctx) defaultMDServer := defaultMDServer(ctx) return fmt.Sprintf(` (KEYBASE_RUN_MODE=%s) -bserver=%s -mdserver=%s`, runMode, defaultBServer, defaultMDServer) }
go
func GetDefaultsUsageString(ctx Context) string { runMode := ctx.GetRunMode() defaultBServer := defaultBServer(ctx) defaultMDServer := defaultMDServer(ctx) return fmt.Sprintf(` (KEYBASE_RUN_MODE=%s) -bserver=%s -mdserver=%s`, runMode, defaultBServer, defaultMDServer) }
[ "func", "GetDefaultsUsageString", "(", "ctx", "Context", ")", "string", "{", "runMode", ":=", "ctx", ".", "GetRunMode", "(", ")", "\n", "defaultBServer", ":=", "defaultBServer", "(", "ctx", ")", "\n", "defaultMDServer", ":=", "defaultMDServer", "(", "ctx", ")"...
// GetDefaultsUsageString returns a string describing the default // values of flags based on the run mode.
[ "GetDefaultsUsageString", "returns", "a", "string", "describing", "the", "default", "values", "of", "flags", "based", "on", "the", "run", "mode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L354-L362
158,910
keybase/client
go/kbfs/libkbfs/init.go
InitLogWithPrefix
func InitLogWithPrefix( params InitParams, ctx Context, prefix string, defaultLogPath string) (logger.Logger, error) { var err error // Set log file to default if log-to-file was specified if params.LogToFile { if params.LogFileConfig.Path != "" { return nil, fmt.Errorf( "log-to-file and log-file flags c...
go
func InitLogWithPrefix( params InitParams, ctx Context, prefix string, defaultLogPath string) (logger.Logger, error) { var err error // Set log file to default if log-to-file was specified if params.LogToFile { if params.LogFileConfig.Path != "" { return nil, fmt.Errorf( "log-to-file and log-file flags c...
[ "func", "InitLogWithPrefix", "(", "params", "InitParams", ",", "ctx", "Context", ",", "prefix", "string", ",", "defaultLogPath", "string", ")", "(", "logger", ".", "Logger", ",", "error", ")", "{", "var", "err", "error", "\n\n", "// Set log file to default if lo...
// InitLogWithPrefix sets up logging switching to a log file if // necessary, given a prefix and a default log path. Returns a valid // logger even on error, which are non-fatal, thus errors from this // function may be ignored. Possible errors are logged to the logger // returned.
[ "InitLogWithPrefix", "sets", "up", "logging", "switching", "to", "a", "log", "file", "if", "necessary", "given", "a", "prefix", "and", "a", "default", "log", "path", ".", "Returns", "a", "valid", "logger", "even", "on", "error", "which", "are", "non", "-",...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L476-L504
158,911
keybase/client
go/kbfs/libkbfs/init.go
InitLog
func InitLog(params InitParams, ctx Context) (logger.Logger, error) { return InitLogWithPrefix(params, ctx, "kbfs", defaultLogPath(ctx)) }
go
func InitLog(params InitParams, ctx Context) (logger.Logger, error) { return InitLogWithPrefix(params, ctx, "kbfs", defaultLogPath(ctx)) }
[ "func", "InitLog", "(", "params", "InitParams", ",", "ctx", "Context", ")", "(", "logger", ".", "Logger", ",", "error", ")", "{", "return", "InitLogWithPrefix", "(", "params", ",", "ctx", ",", "\"", "\"", ",", "defaultLogPath", "(", "ctx", ")", ")", "\...
// InitLog sets up logging switching to a log file if necessary. // Returns a valid logger even on error, which are non-fatal, thus // errors from this function may be ignored. // Possible errors are logged to the logger returned.
[ "InitLog", "sets", "up", "logging", "switching", "to", "a", "log", "file", "if", "necessary", ".", "Returns", "a", "valid", "logger", "even", "on", "error", "which", "are", "non", "-", "fatal", "thus", "errors", "from", "this", "function", "may", "be", "...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/init.go#L510-L512
158,912
keybase/client
go/engine/account_delete.go
NewAccountDelete
func NewAccountDelete(g *libkb.GlobalContext) *AccountDelete { return &AccountDelete{ Contextified: libkb.NewContextified(g), } }
go
func NewAccountDelete(g *libkb.GlobalContext) *AccountDelete { return &AccountDelete{ Contextified: libkb.NewContextified(g), } }
[ "func", "NewAccountDelete", "(", "g", "*", "libkb", ".", "GlobalContext", ")", "*", "AccountDelete", "{", "return", "&", "AccountDelete", "{", "Contextified", ":", "libkb", ".", "NewContextified", "(", "g", ")", ",", "}", "\n", "}" ]
// NewAccountDelete creates a AccountDelete engine.
[ "NewAccountDelete", "creates", "a", "AccountDelete", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/account_delete.go#L18-L22
158,913
keybase/client
go/kbfs/libgit/autogit_node_wrappers.go
ShouldCreateMissedLookup
func (rdn *repoDirNode) ShouldCreateMissedLookup( ctx context.Context, name string) ( bool, context.Context, data.EntryType, os.FileInfo, string) { switch { case strings.HasPrefix(name, AutogitBranchPrefix): branchName := strings.TrimPrefix(name, AutogitBranchPrefix) if len(branchName) == 0 { return rdn.Node...
go
func (rdn *repoDirNode) ShouldCreateMissedLookup( ctx context.Context, name string) ( bool, context.Context, data.EntryType, os.FileInfo, string) { switch { case strings.HasPrefix(name, AutogitBranchPrefix): branchName := strings.TrimPrefix(name, AutogitBranchPrefix) if len(branchName) == 0 { return rdn.Node...
[ "func", "(", "rdn", "*", "repoDirNode", ")", "ShouldCreateMissedLookup", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "bool", ",", "context", ".", "Context", ",", "data", ".", "EntryType", ",", "os", ".", "FileInfo", ",", "stri...
// ShouldCreateMissedLookup implements the Node interface for // repoDirNode.
[ "ShouldCreateMissedLookup", "implements", "the", "Node", "interface", "for", "repoDirNode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_node_wrappers.go#L138-L174
158,914
keybase/client
go/kbfs/libgit/autogit_node_wrappers.go
WrapChild
func (arn autogitRootNode) WrapChild(child libkbfs.Node) libkbfs.Node { child = arn.Node.WrapChild(child) repo := normalizeRepoName(child.GetBasename()) return &repoDirNode{ Node: child, am: arn.am, gitRootFS: arn.fs, repo: repo, subdir: "", branch: "", } }
go
func (arn autogitRootNode) WrapChild(child libkbfs.Node) libkbfs.Node { child = arn.Node.WrapChild(child) repo := normalizeRepoName(child.GetBasename()) return &repoDirNode{ Node: child, am: arn.am, gitRootFS: arn.fs, repo: repo, subdir: "", branch: "", } }
[ "func", "(", "arn", "autogitRootNode", ")", "WrapChild", "(", "child", "libkbfs", ".", "Node", ")", "libkbfs", ".", "Node", "{", "child", "=", "arn", ".", "Node", ".", "WrapChild", "(", "child", ")", "\n", "repo", ":=", "normalizeRepoName", "(", "child",...
// WrapChild implements the Node interface for autogitRootNode.
[ "WrapChild", "implements", "the", "Node", "interface", "for", "autogitRootNode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_node_wrappers.go#L288-L299
158,915
keybase/client
go/kbfs/libgit/autogit_node_wrappers.go
ShouldCreateMissedLookup
func (rn *rootNode) ShouldCreateMissedLookup(ctx context.Context, name string) ( bool, context.Context, data.EntryType, os.FileInfo, string) { if name != AutogitRoot { return rn.Node.ShouldCreateMissedLookup(ctx, name) } rn.lock.Lock() defer rn.lock.Unlock() if rn.fs == nil { // Make the FS once, in a place ...
go
func (rn *rootNode) ShouldCreateMissedLookup(ctx context.Context, name string) ( bool, context.Context, data.EntryType, os.FileInfo, string) { if name != AutogitRoot { return rn.Node.ShouldCreateMissedLookup(ctx, name) } rn.lock.Lock() defer rn.lock.Unlock() if rn.fs == nil { // Make the FS once, in a place ...
[ "func", "(", "rn", "*", "rootNode", ")", "ShouldCreateMissedLookup", "(", "ctx", "context", ".", "Context", ",", "name", "string", ")", "(", "bool", ",", "context", ".", "Context", ",", "data", ".", "EntryType", ",", "os", ".", "FileInfo", ",", "string",...
// ShouldCreateMissedLookup implements the Node interface for // rootNode.
[ "ShouldCreateMissedLookup", "implements", "the", "Node", "interface", "for", "rootNode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_node_wrappers.go#L315-L346
158,916
keybase/client
go/kbfs/libgit/autogit_node_wrappers.go
WrapChild
func (rn *rootNode) WrapChild(child libkbfs.Node) libkbfs.Node { child = rn.Node.WrapChild(child) if child.GetBasename() != AutogitRoot { return child } rn.lock.RLock() defer rn.lock.RUnlock() if rn.fs == nil { rn.am.log.CDebugf(nil, "FS not available on WrapChild") return child } rn.am.log.CDebugf(nil,...
go
func (rn *rootNode) WrapChild(child libkbfs.Node) libkbfs.Node { child = rn.Node.WrapChild(child) if child.GetBasename() != AutogitRoot { return child } rn.lock.RLock() defer rn.lock.RUnlock() if rn.fs == nil { rn.am.log.CDebugf(nil, "FS not available on WrapChild") return child } rn.am.log.CDebugf(nil,...
[ "func", "(", "rn", "*", "rootNode", ")", "WrapChild", "(", "child", "libkbfs", ".", "Node", ")", "libkbfs", ".", "Node", "{", "child", "=", "rn", ".", "Node", ".", "WrapChild", "(", "child", ")", "\n", "if", "child", ".", "GetBasename", "(", ")", "...
// WrapChild implements the Node interface for rootNode.
[ "WrapChild", "implements", "the", "Node", "interface", "for", "rootNode", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_node_wrappers.go#L349-L368
158,917
keybase/client
go/engine/paperkey_primary.go
NewPaperKeyPrimary
func NewPaperKeyPrimary(g *libkb.GlobalContext, args *PaperKeyPrimaryArgs) *PaperKeyPrimary { return &PaperKeyPrimary{ args: args, Contextified: libkb.NewContextified(g), } }
go
func NewPaperKeyPrimary(g *libkb.GlobalContext, args *PaperKeyPrimaryArgs) *PaperKeyPrimary { return &PaperKeyPrimary{ args: args, Contextified: libkb.NewContextified(g), } }
[ "func", "NewPaperKeyPrimary", "(", "g", "*", "libkb", ".", "GlobalContext", ",", "args", "*", "PaperKeyPrimaryArgs", ")", "*", "PaperKeyPrimary", "{", "return", "&", "PaperKeyPrimary", "{", "args", ":", "args", ",", "Contextified", ":", "libkb", ".", "NewConte...
// NewPaperKeyPrimary creates a PaperKeyPrimary engine.
[ "NewPaperKeyPrimary", "creates", "a", "PaperKeyPrimary", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/paperkey_primary.go#L30-L35
158,918
keybase/client
go/libkb/uid.go
CheckUIDAgainstCasedUsername
func CheckUIDAgainstCasedUsername(uid keybase1.UID, username string) (err error) { u2 := UsernameToUIDPreserveCase(username) if uid.NotEqual(u2) { err = UIDMismatchError{fmt.Sprintf("%s != %s (via %s)", uid, u2, username)} } return }
go
func CheckUIDAgainstCasedUsername(uid keybase1.UID, username string) (err error) { u2 := UsernameToUIDPreserveCase(username) if uid.NotEqual(u2) { err = UIDMismatchError{fmt.Sprintf("%s != %s (via %s)", uid, u2, username)} } return }
[ "func", "CheckUIDAgainstCasedUsername", "(", "uid", "keybase1", ".", "UID", ",", "username", "string", ")", "(", "err", "error", ")", "{", "u2", ":=", "UsernameToUIDPreserveCase", "(", "username", ")", "\n", "if", "uid", ".", "NotEqual", "(", "u2", ")", "{...
// CheckUIDAgainstCasedUsername takes the input string, does not convert toLower, // and then hashes it to recover a UID. This is a workaround for some // users whose UIDs were computed incorrectly.
[ "CheckUIDAgainstCasedUsername", "takes", "the", "input", "string", "does", "not", "convert", "toLower", "and", "then", "hashes", "it", "to", "recover", "a", "UID", ".", "This", "is", "a", "workaround", "for", "some", "users", "whose", "UIDs", "were", "computed...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/uid.go#L80-L86
158,919
keybase/client
go/merklestore/store.go
fetch
func (s *MerkleStoreImpl) fetch(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) (keybase1.MerkleStoreKit, error) { m.Debug("MerkleStore: fetching from server: %s", hash) var res merkleStoreServerRes err := m.G().API.GetDecode(m, libkb.APIArg{ Endpoint: s.endpoint, SessionType: libkb.APISessionTypeNONE,...
go
func (s *MerkleStoreImpl) fetch(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) (keybase1.MerkleStoreKit, error) { m.Debug("MerkleStore: fetching from server: %s", hash) var res merkleStoreServerRes err := m.G().API.GetDecode(m, libkb.APIArg{ Endpoint: s.endpoint, SessionType: libkb.APISessionTypeNONE,...
[ "func", "(", "s", "*", "MerkleStoreImpl", ")", "fetch", "(", "m", "libkb", ".", "MetaContext", ",", "hash", "keybase1", ".", "MerkleStoreKitHash", ")", "(", "keybase1", ".", "MerkleStoreKit", ",", "error", ")", "{", "m", ".", "Debug", "(", "\"", "\"", ...
// Fetch data and check the hash.
[ "Fetch", "data", "and", "check", "the", "hash", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/merklestore/store.go#L247-L268
158,920
keybase/client
go/merklestore/store.go
refreshRoot
func (s *MerkleStoreImpl) refreshRoot(m libkb.MetaContext) error { q := libkb.NewHTTPArgs() // The user lookup here is unnecessary. It is done because that is what is // easy with MerkleClient. The user looked up is you if known, otherwise // arbitrarily t_alice. If t_alice is removed, this path will break. uid ...
go
func (s *MerkleStoreImpl) refreshRoot(m libkb.MetaContext) error { q := libkb.NewHTTPArgs() // The user lookup here is unnecessary. It is done because that is what is // easy with MerkleClient. The user looked up is you if known, otherwise // arbitrarily t_alice. If t_alice is removed, this path will break. uid ...
[ "func", "(", "s", "*", "MerkleStoreImpl", ")", "refreshRoot", "(", "m", "libkb", ".", "MetaContext", ")", "error", "{", "q", ":=", "libkb", ".", "NewHTTPArgs", "(", ")", "\n", "// The user lookup here is unnecessary. It is done because that is what is", "// easy with ...
// updateRoot kicks MerkleClient to update its merkle root // by doing a LookupUser on some arbitrary user.
[ "updateRoot", "kicks", "MerkleClient", "to", "update", "its", "merkle", "root", "by", "doing", "a", "LookupUser", "on", "some", "arbitrary", "user", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/merklestore/store.go#L272-L285
158,921
keybase/client
go/merklestore/store.go
dbGet
func (s *MerkleStoreImpl) dbGet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) *keybase1.MerkleStoreKit { db := m.G().LocalDb if db == nil { return nil } var entry dbKit if found, err := db.GetInto(&entry, s.dbKey()); err != nil { m.Debug("MerkleStore: error reading from db: %s", err) return nil } e...
go
func (s *MerkleStoreImpl) dbGet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash) *keybase1.MerkleStoreKit { db := m.G().LocalDb if db == nil { return nil } var entry dbKit if found, err := db.GetInto(&entry, s.dbKey()); err != nil { m.Debug("MerkleStore: error reading from db: %s", err) return nil } e...
[ "func", "(", "s", "*", "MerkleStoreImpl", ")", "dbGet", "(", "m", "libkb", ".", "MetaContext", ",", "hash", "keybase1", ".", "MerkleStoreKitHash", ")", "*", "keybase1", ".", "MerkleStoreKit", "{", "db", ":=", "m", ".", "G", "(", ")", ".", "LocalDb", "\...
// Get from local db. Can return nil.
[ "Get", "from", "local", "db", ".", "Can", "return", "nil", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/merklestore/store.go#L306-L325
158,922
keybase/client
go/merklestore/store.go
dbSet
func (s *MerkleStoreImpl) dbSet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash, kitJSON keybase1.MerkleStoreKit) { db := m.G().LocalDb if db == nil { m.Debug("dbSet: no db") return } entry := dbKit{ DBVersion: dbVersion, Hash: hash, Kit: kitJSON, } if err := db.PutObj(s.dbKey(), nil, e...
go
func (s *MerkleStoreImpl) dbSet(m libkb.MetaContext, hash keybase1.MerkleStoreKitHash, kitJSON keybase1.MerkleStoreKit) { db := m.G().LocalDb if db == nil { m.Debug("dbSet: no db") return } entry := dbKit{ DBVersion: dbVersion, Hash: hash, Kit: kitJSON, } if err := db.PutObj(s.dbKey(), nil, e...
[ "func", "(", "s", "*", "MerkleStoreImpl", ")", "dbSet", "(", "m", "libkb", ".", "MetaContext", ",", "hash", "keybase1", ".", "MerkleStoreKitHash", ",", "kitJSON", "keybase1", ".", "MerkleStoreKit", ")", "{", "db", ":=", "m", ".", "G", "(", ")", ".", "L...
// Logs errors.
[ "Logs", "errors", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/merklestore/store.go#L328-L342
158,923
keybase/client
go/merklestore/store.go
hash
func (s *MerkleStoreImpl) hash(in keybase1.MerkleStoreKit) keybase1.MerkleStoreKitHash { buf := sha512.Sum512([]byte(in)) out := hex.EncodeToString(buf[:]) return keybase1.MerkleStoreKitHash(out) }
go
func (s *MerkleStoreImpl) hash(in keybase1.MerkleStoreKit) keybase1.MerkleStoreKitHash { buf := sha512.Sum512([]byte(in)) out := hex.EncodeToString(buf[:]) return keybase1.MerkleStoreKitHash(out) }
[ "func", "(", "s", "*", "MerkleStoreImpl", ")", "hash", "(", "in", "keybase1", ".", "MerkleStoreKit", ")", "keybase1", ".", "MerkleStoreKitHash", "{", "buf", ":=", "sha512", ".", "Sum512", "(", "[", "]", "byte", "(", "in", ")", ")", "\n", "out", ":=", ...
// hex of sha512
[ "hex", "of", "sha512" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/merklestore/store.go#L345-L349
158,924
keybase/client
go/kbfs/tlf/errors.go
Error
func (e HandleExtensionMismatchError) Error() string { return fmt.Sprintf("Folder handle extension mismatch, "+ "expected: %s, actual: %s", e.Expected, e.Actual) }
go
func (e HandleExtensionMismatchError) Error() string { return fmt.Sprintf("Folder handle extension mismatch, "+ "expected: %s, actual: %s", e.Expected, e.Actual) }
[ "func", "(", "e", "HandleExtensionMismatchError", ")", "Error", "(", ")", "string", "{", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", "+", "\"", "\"", ",", "e", ".", "Expected", ",", "e", ".", "Actual", ")", "\n", "}" ]
// Error implements the error interface for HandleExtensionMismatchError
[ "Error", "implements", "the", "error", "interface", "for", "HandleExtensionMismatchError" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/errors.go#L28-L31
158,925
keybase/client
go/kbfs/libdokan/common.go
fillStat
func fillStat(a *dokan.Stat, de *data.EntryInfo) { a.FileSize = int64(de.Size) a.LastWrite = time.Unix(0, de.Mtime) a.LastAccess = a.LastWrite a.Creation = time.Unix(0, de.Ctime) switch de.Type { case data.File, data.Exec: a.FileAttributes = dokan.FileAttributeNormal case data.Dir: a.FileAttributes = dokan.F...
go
func fillStat(a *dokan.Stat, de *data.EntryInfo) { a.FileSize = int64(de.Size) a.LastWrite = time.Unix(0, de.Mtime) a.LastAccess = a.LastWrite a.Creation = time.Unix(0, de.Ctime) switch de.Type { case data.File, data.Exec: a.FileAttributes = dokan.FileAttributeNormal case data.Dir: a.FileAttributes = dokan.F...
[ "func", "fillStat", "(", "a", "*", "dokan", ".", "Stat", ",", "de", "*", "data", ".", "EntryInfo", ")", "{", "a", ".", "FileSize", "=", "int64", "(", "de", ".", "Size", ")", "\n", "a", ".", "LastWrite", "=", "time", ".", "Unix", "(", "0", ",", ...
// fillStat fill a dokan.Stat from a libkbfs.DirEntry. // Note that handling symlinks to directories requires extra processing not done here.
[ "fillStat", "fill", "a", "dokan", ".", "Stat", "from", "a", "libkbfs", ".", "DirEntry", ".", "Note", "that", "handling", "symlinks", "to", "directories", "requires", "extra", "processing", "not", "done", "here", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L59-L73
158,926
keybase/client
go/kbfs/libdokan/common.go
addFileAttribute
func addFileAttribute(a *dokan.Stat, fa dokan.FileAttribute) { // FileAttributeNormal is valid only if no other attribute is set. // Thus clear the normal flag (if set) from the attributes and or // the new flag. a.FileAttributes = (a.FileAttributes &^ dokan.FileAttributeNormal) | fa }
go
func addFileAttribute(a *dokan.Stat, fa dokan.FileAttribute) { // FileAttributeNormal is valid only if no other attribute is set. // Thus clear the normal flag (if set) from the attributes and or // the new flag. a.FileAttributes = (a.FileAttributes &^ dokan.FileAttributeNormal) | fa }
[ "func", "addFileAttribute", "(", "a", "*", "dokan", ".", "Stat", ",", "fa", "dokan", ".", "FileAttribute", ")", "{", "// FileAttributeNormal is valid only if no other attribute is set.", "// Thus clear the normal flag (if set) from the attributes and or", "// the new flag.", "a",...
// addFileAttribute adds a file attribute to the stat struct.
[ "addFileAttribute", "adds", "a", "file", "attribute", "to", "the", "stat", "struct", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L76-L81
158,927
keybase/client
go/kbfs/libdokan/common.go
errToDokan
func errToDokan(err error) error { switch err.(type) { case idutil.NoSuchNameError: return dokan.ErrObjectNameNotFound case idutil.NoSuchUserError: return dokan.ErrObjectNameNotFound case kbfsmd.ServerErrorUnauthorized: return dokan.ErrAccessDenied case nil: return nil } return err }
go
func errToDokan(err error) error { switch err.(type) { case idutil.NoSuchNameError: return dokan.ErrObjectNameNotFound case idutil.NoSuchUserError: return dokan.ErrObjectNameNotFound case kbfsmd.ServerErrorUnauthorized: return dokan.ErrAccessDenied case nil: return nil } return err }
[ "func", "errToDokan", "(", "err", "error", ")", "error", "{", "switch", "err", ".", "(", "type", ")", "{", "case", "idutil", ".", "NoSuchNameError", ":", "return", "dokan", ".", "ErrObjectNameNotFound", "\n", "case", "idutil", ".", "NoSuchUserError", ":", ...
// errToDokan makes some libkbfs errors easier to digest in dokan. Not needed in most places.
[ "errToDokan", "makes", "some", "libkbfs", "errors", "easier", "to", "digest", "in", "dokan", ".", "Not", "needed", "in", "most", "places", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L84-L96
158,928
keybase/client
go/kbfs/libdokan/common.go
defaultDirectoryInformation
func defaultDirectoryInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeDirectory return &st, nil }
go
func defaultDirectoryInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeDirectory return &st, nil }
[ "func", "defaultDirectoryInformation", "(", ")", "(", "*", "dokan", ".", "Stat", ",", "error", ")", "{", "var", "st", "dokan", ".", "Stat", "\n", "st", ".", "FileAttributes", "=", "dokan", ".", "FileAttributeDirectory", "\n", "return", "&", "st", ",", "n...
// defaultDirectoryInformation returns default directory information.
[ "defaultDirectoryInformation", "returns", "default", "directory", "information", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L99-L103
158,929
keybase/client
go/kbfs/libdokan/common.go
defaultFileInformation
func defaultFileInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeNormal return &st, nil }
go
func defaultFileInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeNormal return &st, nil }
[ "func", "defaultFileInformation", "(", ")", "(", "*", "dokan", ".", "Stat", ",", "error", ")", "{", "var", "st", "dokan", ".", "Stat", "\n", "st", ".", "FileAttributes", "=", "dokan", ".", "FileAttributeNormal", "\n", "return", "&", "st", ",", "nil", "...
// defaultFileInformation returns default file information.
[ "defaultFileInformation", "returns", "default", "file", "information", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L106-L110
158,930
keybase/client
go/kbfs/libdokan/common.go
defaultSymlinkFileInformation
func defaultSymlinkFileInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeReparsePoint st.ReparsePointTag = dokan.IOReparseTagSymlink return &st, nil }
go
func defaultSymlinkFileInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeReparsePoint st.ReparsePointTag = dokan.IOReparseTagSymlink return &st, nil }
[ "func", "defaultSymlinkFileInformation", "(", ")", "(", "*", "dokan", ".", "Stat", ",", "error", ")", "{", "var", "st", "dokan", ".", "Stat", "\n", "st", ".", "FileAttributes", "=", "dokan", ".", "FileAttributeReparsePoint", "\n", "st", ".", "ReparsePointTag...
// defaultSymlinkFileInformation returns default symlink to file information.
[ "defaultSymlinkFileInformation", "returns", "default", "symlink", "to", "file", "information", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L113-L118
158,931
keybase/client
go/kbfs/libdokan/common.go
defaultSymlinkDirInformation
func defaultSymlinkDirInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeReparsePoint | dokan.FileAttributeDirectory st.ReparsePointTag = dokan.IOReparseTagSymlink return &st, nil }
go
func defaultSymlinkDirInformation() (*dokan.Stat, error) { var st dokan.Stat st.FileAttributes = dokan.FileAttributeReparsePoint | dokan.FileAttributeDirectory st.ReparsePointTag = dokan.IOReparseTagSymlink return &st, nil }
[ "func", "defaultSymlinkDirInformation", "(", ")", "(", "*", "dokan", ".", "Stat", ",", "error", ")", "{", "var", "st", "dokan", ".", "Stat", "\n", "st", ".", "FileAttributes", "=", "dokan", ".", "FileAttributeReparsePoint", "|", "dokan", ".", "FileAttributeD...
// defaultSymlinkDirInformation returns default symlink to directory information.
[ "defaultSymlinkDirInformation", "returns", "default", "symlink", "to", "directory", "information", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/common.go#L121-L126
158,932
keybase/client
go/kbfs/libkbfs/block_disk_store.go
makeBlockDiskStore
func makeBlockDiskStore(codec kbfscodec.Codec, dir string) *blockDiskStore { return &blockDiskStore{ codec: codec, dir: dir, puts: make(map[kbfsblock.ID]<-chan struct{}), } }
go
func makeBlockDiskStore(codec kbfscodec.Codec, dir string) *blockDiskStore { return &blockDiskStore{ codec: codec, dir: dir, puts: make(map[kbfsblock.ID]<-chan struct{}), } }
[ "func", "makeBlockDiskStore", "(", "codec", "kbfscodec", ".", "Codec", ",", "dir", "string", ")", "*", "blockDiskStore", "{", "return", "&", "blockDiskStore", "{", "codec", ":", "codec", ",", "dir", ":", "dir", ",", "puts", ":", "make", "(", "map", "[", ...
// makeBlockDiskStore returns a new blockDiskStore for the given // directory.
[ "makeBlockDiskStore", "returns", "a", "new", "blockDiskStore", "for", "the", "given", "directory", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L96-L102
158,933
keybase/client
go/kbfs/libkbfs/block_disk_store.go
blockPath
func (s *blockDiskStore) blockPath(id kbfsblock.ID) string { // Truncate to 34 characters, which corresponds to 16 random // bytes (since the first byte is a hash type) or 128 random // bits, which means that the expected number of blocks // generated before getting a path collision is 2^64 (see // https://en.wiki...
go
func (s *blockDiskStore) blockPath(id kbfsblock.ID) string { // Truncate to 34 characters, which corresponds to 16 random // bytes (since the first byte is a hash type) or 128 random // bits, which means that the expected number of blocks // generated before getting a path collision is 2^64 (see // https://en.wiki...
[ "func", "(", "s", "*", "blockDiskStore", ")", "blockPath", "(", "id", "kbfsblock", ".", "ID", ")", "string", "{", "// Truncate to 34 characters, which corresponds to 16 random", "// bytes (since the first byte is a hash type) or 128 random", "// bits, which means that the expected ...
// The functions below are for building various paths.
[ "The", "functions", "below", "are", "for", "building", "various", "paths", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L106-L115
158,934
keybase/client
go/kbfs/libkbfs/block_disk_store.go
makeDir
func (s *blockDiskStore) makeDir(id kbfsblock.ID) error { err := ioutil.MkdirAll(s.blockPath(id), 0700) if err != nil { return err } // TODO: Only write if the file doesn't exist. return ioutil.WriteFile(s.idPath(id), []byte(id.String()), 0600) }
go
func (s *blockDiskStore) makeDir(id kbfsblock.ID) error { err := ioutil.MkdirAll(s.blockPath(id), 0700) if err != nil { return err } // TODO: Only write if the file doesn't exist. return ioutil.WriteFile(s.idPath(id), []byte(id.String()), 0600) }
[ "func", "(", "s", "*", "blockDiskStore", ")", "makeDir", "(", "id", "kbfsblock", ".", "ID", ")", "error", "{", "err", ":=", "ioutil", ".", "MkdirAll", "(", "s", ".", "blockPath", "(", "id", ")", ",", "0700", ")", "\n", "if", "err", "!=", "nil", "...
// makeDir makes the directory for the given block ID and writes the // ID file, if necessary.
[ "makeDir", "makes", "the", "directory", "for", "the", "given", "block", "ID", "and", "writes", "the", "ID", "file", "if", "necessary", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L139-L148
158,935
keybase/client
go/kbfs/libkbfs/block_disk_store.go
getInfo
func (s *blockDiskStore) getInfo(id kbfsblock.ID) (blockJournalInfo, error) { var info blockJournalInfo err := kbfscodec.DeserializeFromFile(s.codec, s.infoPath(id), &info) if !ioutil.IsNotExist(err) && err != nil { return blockJournalInfo{}, err } if info.Refs == nil { info.Refs = make(blockRefMap) } retu...
go
func (s *blockDiskStore) getInfo(id kbfsblock.ID) (blockJournalInfo, error) { var info blockJournalInfo err := kbfscodec.DeserializeFromFile(s.codec, s.infoPath(id), &info) if !ioutil.IsNotExist(err) && err != nil { return blockJournalInfo{}, err } if info.Refs == nil { info.Refs = make(blockRefMap) } retu...
[ "func", "(", "s", "*", "blockDiskStore", ")", "getInfo", "(", "id", "kbfsblock", ".", "ID", ")", "(", "blockJournalInfo", ",", "error", ")", "{", "var", "info", "blockJournalInfo", "\n", "err", ":=", "kbfscodec", ".", "DeserializeFromFile", "(", "s", ".", ...
// getRefInfo returns the references for the given ID. exclusify must // have been called by the caller.
[ "getRefInfo", "returns", "the", "references", "for", "the", "given", "ID", ".", "exclusify", "must", "have", "been", "called", "by", "the", "caller", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L210-L222
158,936
keybase/client
go/kbfs/libkbfs/block_disk_store.go
putInfo
func (s *blockDiskStore) putInfo( id kbfsblock.ID, info blockJournalInfo) error { return kbfscodec.SerializeToFile(s.codec, info, s.infoPath(id)) }
go
func (s *blockDiskStore) putInfo( id kbfsblock.ID, info blockJournalInfo) error { return kbfscodec.SerializeToFile(s.codec, info, s.infoPath(id)) }
[ "func", "(", "s", "*", "blockDiskStore", ")", "putInfo", "(", "id", "kbfsblock", ".", "ID", ",", "info", "blockJournalInfo", ")", "error", "{", "return", "kbfscodec", ".", "SerializeToFile", "(", "s", ".", "codec", ",", "info", ",", "s", ".", "infoPath",...
// putRefInfo stores the given references for the given ID. exclusify // must have been called by the caller.
[ "putRefInfo", "stores", "the", "given", "references", "for", "the", "given", "ID", ".", "exclusify", "must", "have", "been", "called", "by", "the", "caller", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L226-L229
158,937
keybase/client
go/kbfs/libkbfs/block_disk_store.go
addRefsExclusive
func (s *blockDiskStore) addRefsExclusive( id kbfsblock.ID, contexts []kbfsblock.Context, status blockRefStatus, tag string) error { info, err := s.getInfo(id) if len(info.Refs) > 0 { // Check existing contexts, if any. for _, context := range contexts { _, _, err := info.Refs.checkExists(context) if err...
go
func (s *blockDiskStore) addRefsExclusive( id kbfsblock.ID, contexts []kbfsblock.Context, status blockRefStatus, tag string) error { info, err := s.getInfo(id) if len(info.Refs) > 0 { // Check existing contexts, if any. for _, context := range contexts { _, _, err := info.Refs.checkExists(context) if err...
[ "func", "(", "s", "*", "blockDiskStore", ")", "addRefsExclusive", "(", "id", "kbfsblock", ".", "ID", ",", "contexts", "[", "]", "kbfsblock", ".", "Context", ",", "status", "blockRefStatus", ",", "tag", "string", ")", "error", "{", "info", ",", "err", ":=...
// addRefs adds references for the given contexts to the given ID, all // with the same status and tag. `exclusify` must be called by the // caller.
[ "addRefs", "adds", "references", "for", "the", "given", "contexts", "to", "the", "given", "ID", "all", "with", "the", "same", "status", "and", "tag", ".", "exclusify", "must", "be", "called", "by", "the", "caller", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L234-L257
158,938
keybase/client
go/kbfs/libkbfs/block_disk_store.go
getDataExclusive
func (s *blockDiskStore) getDataExclusive(id kbfsblock.ID) ( []byte, kbfscrypto.BlockCryptKeyServerHalf, error) { data, err := ioutil.ReadFile(s.dataPath(id)) if ioutil.IsNotExist(err) { return nil, kbfscrypto.BlockCryptKeyServerHalf{}, blockNonExistentError{id} } else if err != nil { return nil, kbfscrypto....
go
func (s *blockDiskStore) getDataExclusive(id kbfsblock.ID) ( []byte, kbfscrypto.BlockCryptKeyServerHalf, error) { data, err := ioutil.ReadFile(s.dataPath(id)) if ioutil.IsNotExist(err) { return nil, kbfscrypto.BlockCryptKeyServerHalf{}, blockNonExistentError{id} } else if err != nil { return nil, kbfscrypto....
[ "func", "(", "s", "*", "blockDiskStore", ")", "getDataExclusive", "(", "id", "kbfsblock", ".", "ID", ")", "(", "[", "]", "byte", ",", "kbfscrypto", ".", "BlockCryptKeyServerHalf", ",", "error", ")", "{", "data", ",", "err", ":=", "ioutil", ".", "ReadFile...
// getData returns the data and server half for the given ID, if // present. `exclusify` must be called by the caller.
[ "getData", "returns", "the", "data", "and", "server", "half", "for", "the", "given", "ID", "if", "present", ".", "exclusify", "must", "be", "called", "by", "the", "caller", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L261-L294
158,939
keybase/client
go/kbfs/libkbfs/block_disk_store.go
getData
func (s *blockDiskStore) getData(ctx context.Context, id kbfsblock.ID) ( []byte, kbfscrypto.BlockCryptKeyServerHalf, error) { cleanup, err := s.exclusify(ctx, id) if err != nil { return nil, kbfscrypto.BlockCryptKeyServerHalf{}, err } defer cleanup() return s.getDataExclusive(id) }
go
func (s *blockDiskStore) getData(ctx context.Context, id kbfsblock.ID) ( []byte, kbfscrypto.BlockCryptKeyServerHalf, error) { cleanup, err := s.exclusify(ctx, id) if err != nil { return nil, kbfscrypto.BlockCryptKeyServerHalf{}, err } defer cleanup() return s.getDataExclusive(id) }
[ "func", "(", "s", "*", "blockDiskStore", ")", "getData", "(", "ctx", "context", ".", "Context", ",", "id", "kbfsblock", ".", "ID", ")", "(", "[", "]", "byte", ",", "kbfscrypto", ".", "BlockCryptKeyServerHalf", ",", "error", ")", "{", "cleanup", ",", "e...
// getData returns the data and server half for the given ID, if // present.
[ "getData", "returns", "the", "data", "and", "server", "half", "for", "the", "given", "ID", "if", "present", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L298-L307
158,940
keybase/client
go/kbfs/libkbfs/block_disk_store.go
put
func (s *blockDiskStore) put( ctx context.Context, isRegularPut bool, id kbfsblock.ID, context kbfsblock.Context, buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf) ( putData bool, err error) { cleanup, err := s.exclusify(ctx, id) if err != nil { return false, err } defer cleanup() err = validateBlo...
go
func (s *blockDiskStore) put( ctx context.Context, isRegularPut bool, id kbfsblock.ID, context kbfsblock.Context, buf []byte, serverHalf kbfscrypto.BlockCryptKeyServerHalf) ( putData bool, err error) { cleanup, err := s.exclusify(ctx, id) if err != nil { return false, err } defer cleanup() err = validateBlo...
[ "func", "(", "s", "*", "blockDiskStore", ")", "put", "(", "ctx", "context", ".", "Context", ",", "isRegularPut", "bool", ",", "id", "kbfsblock", ".", "ID", ",", "context", "kbfsblock", ".", "Context", ",", "buf", "[", "]", "byte", ",", "serverHalf", "k...
// put puts the given data for the block, which may already exist, and // adds a reference for the given context. If isRegularPut is true, // additional validity checks are performed. If err is nil, putData // indicates whether the data didn't already exist and was put; if // false, it means that the data already exis...
[ "put", "puts", "the", "given", "data", "for", "the", "block", "which", "may", "already", "exist", "and", "adds", "a", "reference", "for", "the", "given", "context", ".", "If", "isRegularPut", "is", "true", "additional", "validity", "checks", "are", "performe...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L573-L638
158,941
keybase/client
go/kbfs/libkbfs/block_disk_store.go
remove
func (s *blockDiskStore) remove(ctx context.Context, id kbfsblock.ID) error { cleanup, err := s.exclusify(ctx, id) if err != nil { return err } defer cleanup() hasAnyRef, err := s.hasAnyRefExclusive(id) if err != nil { return err } if hasAnyRef { return errors.Errorf( "Trying to remove data for refere...
go
func (s *blockDiskStore) remove(ctx context.Context, id kbfsblock.ID) error { cleanup, err := s.exclusify(ctx, id) if err != nil { return err } defer cleanup() hasAnyRef, err := s.hasAnyRefExclusive(id) if err != nil { return err } if hasAnyRef { return errors.Errorf( "Trying to remove data for refere...
[ "func", "(", "s", "*", "blockDiskStore", ")", "remove", "(", "ctx", "context", ".", "Context", ",", "id", "kbfsblock", ".", "ID", ")", "error", "{", "cleanup", ",", "err", ":=", "s", ".", "exclusify", "(", "ctx", ",", "id", ")", "\n", "if", "err", ...
// remove removes any existing data for the given ID, which must not // have any references left.
[ "remove", "removes", "any", "existing", "data", "for", "the", "given", "ID", "which", "must", "not", "have", "any", "references", "left", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/block_disk_store.go#L728-L757
158,942
keybase/client
go/chat/storage/inbox.go
getConvsForTeam
func (i *Inbox) getConvsForTeam(ctx context.Context, teamID keybase1.TeamID, convs []types.RemoteConversation) (res []*types.RemoteConversation) { tlfID, err := chat1.TeamIDToTLFID(teamID) if err != nil { i.Debug(ctx, "getConvsForTeam: teamIDToTLFID failed: %v", err) return nil } for i := range convs { conv :...
go
func (i *Inbox) getConvsForTeam(ctx context.Context, teamID keybase1.TeamID, convs []types.RemoteConversation) (res []*types.RemoteConversation) { tlfID, err := chat1.TeamIDToTLFID(teamID) if err != nil { i.Debug(ctx, "getConvsForTeam: teamIDToTLFID failed: %v", err) return nil } for i := range convs { conv :...
[ "func", "(", "i", "*", "Inbox", ")", "getConvsForTeam", "(", "ctx", "context", ".", "Context", ",", "teamID", "keybase1", ".", "TeamID", ",", "convs", "[", "]", "types", ".", "RemoteConversation", ")", "(", "res", "[", "]", "*", "types", ".", "RemoteCo...
// Return pointers into `convs` for the convs belonging to `teamID`.
[ "Return", "pointers", "into", "convs", "for", "the", "convs", "belonging", "to", "teamID", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/inbox.go#L893-L906
158,943
keybase/client
go/chat/storage/inbox.go
SetTeamRetention
func (i *Inbox) SetTeamRetention(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers, teamID keybase1.TeamID, policy chat1.RetentionPolicy) (res []chat1.ConversationID, err Error) { defer i.Trace(ctx, func() error { return err }, "SetTeamRetention")() locks.Inbox.Lock() defer locks.Inbox.Unlock() defer i.ma...
go
func (i *Inbox) SetTeamRetention(ctx context.Context, uid gregor1.UID, vers chat1.InboxVers, teamID keybase1.TeamID, policy chat1.RetentionPolicy) (res []chat1.ConversationID, err Error) { defer i.Trace(ctx, func() error { return err }, "SetTeamRetention")() locks.Inbox.Lock() defer locks.Inbox.Unlock() defer i.ma...
[ "func", "(", "i", "*", "Inbox", ")", "SetTeamRetention", "(", "ctx", "context", ".", "Context", ",", "uid", "gregor1", ".", "UID", ",", "vers", "chat1", ".", "InboxVers", ",", "teamID", "keybase1", ".", "TeamID", ",", "policy", "chat1", ".", "RetentionPo...
// Update any local conversations with this team ID.
[ "Update", "any", "local", "conversations", "with", "this", "team", "ID", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/inbox.go#L1301-L1334
158,944
keybase/client
go/kbfs/tlf/id.go
FolderType
func (t Type) FolderType() keybase1.FolderType { switch t { case Private: return keybase1.FolderType_PRIVATE case Public: return keybase1.FolderType_PUBLIC case SingleTeam: return keybase1.FolderType_TEAM default: return keybase1.FolderType_UNKNOWN } }
go
func (t Type) FolderType() keybase1.FolderType { switch t { case Private: return keybase1.FolderType_PRIVATE case Public: return keybase1.FolderType_PUBLIC case SingleTeam: return keybase1.FolderType_TEAM default: return keybase1.FolderType_UNKNOWN } }
[ "func", "(", "t", "Type", ")", "FolderType", "(", ")", "keybase1", ".", "FolderType", "{", "switch", "t", "{", "case", "Private", ":", "return", "keybase1", ".", "FolderType_PRIVATE", "\n", "case", "Public", ":", "return", "keybase1", ".", "FolderType_PUBLIC...
// FolderType returns the keybase1.FolderType corresponding to the // given TLF type.
[ "FolderType", "returns", "the", "keybase1", ".", "FolderType", "corresponding", "to", "the", "given", "TLF", "type", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L88-L99
158,945
keybase/client
go/kbfs/tlf/id.go
ParseTlfTypeFromPath
func ParseTlfTypeFromPath(str string) (Type, error) { switch strings.ToLower(str) { case strPrivate: return Private, nil case strPublic: return Public, nil case strTeam: return SingleTeam, nil default: return Unknown, ErrUnknownTLFType{unknownType: str} } }
go
func ParseTlfTypeFromPath(str string) (Type, error) { switch strings.ToLower(str) { case strPrivate: return Private, nil case strPublic: return Public, nil case strTeam: return SingleTeam, nil default: return Unknown, ErrUnknownTLFType{unknownType: str} } }
[ "func", "ParseTlfTypeFromPath", "(", "str", "string", ")", "(", "Type", ",", "error", ")", "{", "switch", "strings", ".", "ToLower", "(", "str", ")", "{", "case", "strPrivate", ":", "return", "Private", ",", "nil", "\n", "case", "strPublic", ":", "return...
// ParseTlfTypeFromPath parses str into a Type.
[ "ParseTlfTypeFromPath", "parses", "str", "into", "a", "Type", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L113-L124
158,946
keybase/client
go/kbfs/tlf/id.go
TypeFromFolderType
func TypeFromFolderType(ft keybase1.FolderType) Type { switch ft { case keybase1.FolderType_PRIVATE: return Private case keybase1.FolderType_PUBLIC: return Public case keybase1.FolderType_TEAM: return SingleTeam default: return Unknown } }
go
func TypeFromFolderType(ft keybase1.FolderType) Type { switch ft { case keybase1.FolderType_PRIVATE: return Private case keybase1.FolderType_PUBLIC: return Public case keybase1.FolderType_TEAM: return SingleTeam default: return Unknown } }
[ "func", "TypeFromFolderType", "(", "ft", "keybase1", ".", "FolderType", ")", "Type", "{", "switch", "ft", "{", "case", "keybase1", ".", "FolderType_PRIVATE", ":", "return", "Private", "\n", "case", "keybase1", ".", "FolderType_PUBLIC", ":", "return", "Public", ...
// TypeFromFolderType returns the Type corresponding to the given // keybase1.FolderType.
[ "TypeFromFolderType", "returns", "the", "Type", "corresponding", "to", "the", "given", "keybase1", ".", "FolderType", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L128-L139
158,947
keybase/client
go/kbfs/tlf/id.go
MarshalBinary
func (id ID) MarshalBinary() (data []byte, err error) { suffix := id.id[idByteLen-1] if suffix != idSuffix && suffix != pubIDSuffix && suffix != singleTeamIDSuffix { return nil, errors.WithStack(InvalidIDError{id.String()}) } return id.id[:], nil }
go
func (id ID) MarshalBinary() (data []byte, err error) { suffix := id.id[idByteLen-1] if suffix != idSuffix && suffix != pubIDSuffix && suffix != singleTeamIDSuffix { return nil, errors.WithStack(InvalidIDError{id.String()}) } return id.id[:], nil }
[ "func", "(", "id", "ID", ")", "MarshalBinary", "(", ")", "(", "data", "[", "]", "byte", ",", "err", "error", ")", "{", "suffix", ":=", "id", ".", "id", "[", "idByteLen", "-", "1", "]", "\n", "if", "suffix", "!=", "idSuffix", "&&", "suffix", "!=",...
// MarshalBinary implements the encoding.BinaryMarshaler interface for ID.
[ "MarshalBinary", "implements", "the", "encoding", ".", "BinaryMarshaler", "interface", "for", "ID", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L201-L208
158,948
keybase/client
go/kbfs/tlf/id.go
UnmarshalBinary
func (id *ID) UnmarshalBinary(data []byte) error { if len(data) != idByteLen { return errors.WithStack( InvalidIDError{hex.EncodeToString(data)}) } suffix := data[idByteLen-1] if suffix != idSuffix && suffix != pubIDSuffix && suffix != singleTeamIDSuffix { return errors.WithStack( InvalidIDError{hex.Enc...
go
func (id *ID) UnmarshalBinary(data []byte) error { if len(data) != idByteLen { return errors.WithStack( InvalidIDError{hex.EncodeToString(data)}) } suffix := data[idByteLen-1] if suffix != idSuffix && suffix != pubIDSuffix && suffix != singleTeamIDSuffix { return errors.WithStack( InvalidIDError{hex.Enc...
[ "func", "(", "id", "*", "ID", ")", "UnmarshalBinary", "(", "data", "[", "]", "byte", ")", "error", "{", "if", "len", "(", "data", ")", "!=", "idByteLen", "{", "return", "errors", ".", "WithStack", "(", "InvalidIDError", "{", "hex", ".", "EncodeToString...
// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface // for ID.
[ "UnmarshalBinary", "implements", "the", "encoding", ".", "BinaryUnmarshaler", "interface", "for", "ID", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L212-L225
158,949
keybase/client
go/kbfs/tlf/id.go
SafeType
func (id ID) SafeType() (Type, error) { switch id.id[idByteLen-1] { case idSuffix: return Private, nil case pubIDSuffix: return Public, nil case singleTeamIDSuffix: return SingleTeam, nil default: return Unknown, fmt.Errorf("Unknown ID suffix %x", id.id[idByteLen-1]) } }
go
func (id ID) SafeType() (Type, error) { switch id.id[idByteLen-1] { case idSuffix: return Private, nil case pubIDSuffix: return Public, nil case singleTeamIDSuffix: return SingleTeam, nil default: return Unknown, fmt.Errorf("Unknown ID suffix %x", id.id[idByteLen-1]) } }
[ "func", "(", "id", "ID", ")", "SafeType", "(", ")", "(", "Type", ",", "error", ")", "{", "switch", "id", ".", "id", "[", "idByteLen", "-", "1", "]", "{", "case", "idSuffix", ":", "return", "Private", ",", "nil", "\n", "case", "pubIDSuffix", ":", ...
// SafeType returns the type of TLF represented by this ID. If the ID // isn't valid, it returns tlf.Unknown along with an error.
[ "SafeType", "returns", "the", "type", "of", "TLF", "represented", "by", "this", "ID", ".", "If", "the", "ID", "isn", "t", "valid", "it", "returns", "tlf", ".", "Unknown", "along", "with", "an", "error", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L249-L260
158,950
keybase/client
go/kbfs/tlf/id.go
Type
func (id ID) Type() Type { t, err := id.SafeType() if err != nil { panic(err) } return t }
go
func (id ID) Type() Type { t, err := id.SafeType() if err != nil { panic(err) } return t }
[ "func", "(", "id", "ID", ")", "Type", "(", ")", "Type", "{", "t", ",", "err", ":=", "id", ".", "SafeType", "(", ")", "\n", "if", "err", "!=", "nil", "{", "panic", "(", "err", ")", "\n", "}", "\n", "return", "t", "\n", "}" ]
// Type returns the type of TLF represented by this ID. // // Note that this function panics if the ID suffix is unknown, rather than // returning tlf.Unknown.
[ "Type", "returns", "the", "type", "of", "TLF", "represented", "by", "this", "ID", ".", "Note", "that", "this", "function", "panics", "if", "the", "ID", "suffix", "is", "unknown", "rather", "than", "returning", "tlf", ".", "Unknown", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L266-L272
158,951
keybase/client
go/kbfs/tlf/id.go
ParseID
func ParseID(s string) (ID, error) { var id ID err := id.UnmarshalText([]byte(s)) if err != nil { return ID{}, err } return id, nil }
go
func ParseID(s string) (ID, error) { var id ID err := id.UnmarshalText([]byte(s)) if err != nil { return ID{}, err } return id, nil }
[ "func", "ParseID", "(", "s", "string", ")", "(", "ID", ",", "error", ")", "{", "var", "id", "ID", "\n", "err", ":=", "id", ".", "UnmarshalText", "(", "[", "]", "byte", "(", "s", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "ID", "...
// ParseID parses a hex encoded ID. Returns NullID and an // InvalidIDError on failure.
[ "ParseID", "parses", "a", "hex", "encoded", "ID", ".", "Returns", "NullID", "and", "an", "InvalidIDError", "on", "failure", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L276-L283
158,952
keybase/client
go/kbfs/tlf/id.go
MakeRandomID
func MakeRandomID(t Type) (ID, error) { var idBytes [idByteLen]byte err := kbfscrypto.RandRead(idBytes[:]) if err != nil { return NullID, err } switch t { case Private: idBytes[idByteLen-1] = idSuffix case Public: idBytes[idByteLen-1] = pubIDSuffix case SingleTeam: idBytes[idByteLen-1] = singleTeamIDSuf...
go
func MakeRandomID(t Type) (ID, error) { var idBytes [idByteLen]byte err := kbfscrypto.RandRead(idBytes[:]) if err != nil { return NullID, err } switch t { case Private: idBytes[idByteLen-1] = idSuffix case Public: idBytes[idByteLen-1] = pubIDSuffix case SingleTeam: idBytes[idByteLen-1] = singleTeamIDSuf...
[ "func", "MakeRandomID", "(", "t", "Type", ")", "(", "ID", ",", "error", ")", "{", "var", "idBytes", "[", "idByteLen", "]", "byte", "\n", "err", ":=", "kbfscrypto", ".", "RandRead", "(", "idBytes", "[", ":", "]", ")", "\n", "if", "err", "!=", "nil",...
// MakeRandomID makes a random ID using a cryptographically secure // RNG. Returns NullID on failure.
[ "MakeRandomID", "makes", "a", "random", "ID", "using", "a", "cryptographically", "secure", "RNG", ".", "Returns", "NullID", "on", "failure", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L287-L309
158,953
keybase/client
go/kbfs/tlf/id.go
MakeIDFromTeam
func MakeIDFromTeam(t Type, tid keybase1.TeamID, epoch byte) (ID, error) { idBytes := tid.ToBytes() if len(idBytes) != idByteLen { return NullID, errors.Errorf( "The length of team ID %s doesn't match that of a TLF ID", tid) } idBytes[idByteLen-2] = epoch switch t { case Private: if tid.IsPublic() { r...
go
func MakeIDFromTeam(t Type, tid keybase1.TeamID, epoch byte) (ID, error) { idBytes := tid.ToBytes() if len(idBytes) != idByteLen { return NullID, errors.Errorf( "The length of team ID %s doesn't match that of a TLF ID", tid) } idBytes[idByteLen-2] = epoch switch t { case Private: if tid.IsPublic() { r...
[ "func", "MakeIDFromTeam", "(", "t", "Type", ",", "tid", "keybase1", ".", "TeamID", ",", "epoch", "byte", ")", "(", "ID", ",", "error", ")", "{", "idBytes", ":=", "tid", ".", "ToBytes", "(", ")", "\n", "if", "len", "(", "idBytes", ")", "!=", "idByte...
// MakeIDFromTeam makes a deterministic TLF ID from a team ID and an epoch // representing how many times a new TLF has been needed for this // team. Returns NullID on failure.
[ "MakeIDFromTeam", "makes", "a", "deterministic", "TLF", "ID", "from", "a", "team", "ID", "and", "an", "epoch", "representing", "how", "many", "times", "a", "new", "TLF", "has", "been", "needed", "for", "this", "team", ".", "Returns", "NullID", "on", "failu...
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L314-L351
158,954
keybase/client
go/kbfs/tlf/id.go
GetEpochFromTeamTLF
func (id ID) GetEpochFromTeamTLF(tid keybase1.TeamID) ( matches bool, epoch byte, err error) { tidBytes := tid.ToBytes() if len(tidBytes) != idByteLen { return false, 0, errors.Errorf( "The length of team ID %s doesn't match that of a TLF ID", tid) } epochIndex := idByteLen - 2 if !bytes.Equal(tidBytes[:epo...
go
func (id ID) GetEpochFromTeamTLF(tid keybase1.TeamID) ( matches bool, epoch byte, err error) { tidBytes := tid.ToBytes() if len(tidBytes) != idByteLen { return false, 0, errors.Errorf( "The length of team ID %s doesn't match that of a TLF ID", tid) } epochIndex := idByteLen - 2 if !bytes.Equal(tidBytes[:epo...
[ "func", "(", "id", "ID", ")", "GetEpochFromTeamTLF", "(", "tid", "keybase1", ".", "TeamID", ")", "(", "matches", "bool", ",", "epoch", "byte", ",", "err", "error", ")", "{", "tidBytes", ":=", "tid", ".", "ToBytes", "(", ")", "\n", "if", "len", "(", ...
// GetEpochFromTeamTLF returns 1) whether this ID matches the given // team TID, and 2) if so, which epoch it is.
[ "GetEpochFromTeamTLF", "returns", "1", ")", "whether", "this", "ID", "matches", "the", "given", "team", "TID", "and", "2", ")", "if", "so", "which", "epoch", "it", "is", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlf/id.go#L355-L369
158,955
keybase/client
go/kbfs/libpages/config/passwords.go
GenerateSHA256PasswordHash
func GenerateSHA256PasswordHash(cleartext string) (string, error) { salt := make([]byte, saltSize) n, err := rand.Read(salt) if err != nil || n != saltSize { return "", errors.New("reading random bytes error") } hash := sha256.Sum256(append(salt, cleartext...)) return sha256PasswordHashPrefix + passwordHashDiv...
go
func GenerateSHA256PasswordHash(cleartext string) (string, error) { salt := make([]byte, saltSize) n, err := rand.Read(salt) if err != nil || n != saltSize { return "", errors.New("reading random bytes error") } hash := sha256.Sum256(append(salt, cleartext...)) return sha256PasswordHashPrefix + passwordHashDiv...
[ "func", "GenerateSHA256PasswordHash", "(", "cleartext", "string", ")", "(", "string", ",", "error", ")", "{", "salt", ":=", "make", "(", "[", "]", "byte", ",", "saltSize", ")", "\n", "n", ",", "err", ":=", "rand", ".", "Read", "(", "salt", ")", "\n",...
// GenerateSHA256PasswordHash generates a SHA256 based password hash.
[ "GenerateSHA256PasswordHash", "generates", "a", "SHA256", "based", "password", "hash", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/config/passwords.go#L130-L141
158,956
keybase/client
go/engine/sigslist.go
NewSigsList
func NewSigsList(g *libkb.GlobalContext, args SigsListArgs) *SigsList { return &SigsList{ SigsListArgs: args, Contextified: libkb.NewContextified(g), } }
go
func NewSigsList(g *libkb.GlobalContext, args SigsListArgs) *SigsList { return &SigsList{ SigsListArgs: args, Contextified: libkb.NewContextified(g), } }
[ "func", "NewSigsList", "(", "g", "*", "libkb", ".", "GlobalContext", ",", "args", "SigsListArgs", ")", "*", "SigsList", "{", "return", "&", "SigsList", "{", "SigsListArgs", ":", "args", ",", "Contextified", ":", "libkb", ".", "NewContextified", "(", "g", "...
// NewSigsList creates a SigsList engine.
[ "NewSigsList", "creates", "a", "SigsList", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/sigslist.go#L33-L38
158,957
keybase/client
go/engine/sigslist.go
Sigs
func (e *SigsList) Sigs() []keybase1.Sig { res := make([]keybase1.Sig, len(e.sigs)) for i, s := range e.sigs { var key string fp := s.GetPGPFingerprint() if fp != nil { key = fp.ToDisplayString(e.Verbose) } res[i] = keybase1.Sig{ Seqno: s.GetSeqno(), SigIDDisplay: s.GetSigID().ToDisplayStrin...
go
func (e *SigsList) Sigs() []keybase1.Sig { res := make([]keybase1.Sig, len(e.sigs)) for i, s := range e.sigs { var key string fp := s.GetPGPFingerprint() if fp != nil { key = fp.ToDisplayString(e.Verbose) } res[i] = keybase1.Sig{ Seqno: s.GetSeqno(), SigIDDisplay: s.GetSigID().ToDisplayStrin...
[ "func", "(", "e", "*", "SigsList", ")", "Sigs", "(", ")", "[", "]", "keybase1", ".", "Sig", "{", "res", ":=", "make", "(", "[", "]", "keybase1", ".", "Sig", ",", "len", "(", "e", ".", "sigs", ")", ")", "\n", "for", "i", ",", "s", ":=", "ran...
// Sigs returns the sig list, after processing.
[ "Sigs", "returns", "the", "sig", "list", "after", "processing", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/sigslist.go#L80-L100
158,958
keybase/client
go/libkb/skb_keyring.go
FindSecretKey
func (k *SKBKeyringFile) FindSecretKey(kids []keybase1.KID) (ret *SKB) { k.Lock() defer k.Unlock() for _, kid := range kids { if ret = k.lookupByKidLocked(kid); ret != nil { return } } return }
go
func (k *SKBKeyringFile) FindSecretKey(kids []keybase1.KID) (ret *SKB) { k.Lock() defer k.Unlock() for _, kid := range kids { if ret = k.lookupByKidLocked(kid); ret != nil { return } } return }
[ "func", "(", "k", "*", "SKBKeyringFile", ")", "FindSecretKey", "(", "kids", "[", "]", "keybase1", ".", "KID", ")", "(", "ret", "*", "SKB", ")", "{", "k", ".", "Lock", "(", ")", "\n", "defer", "k", ".", "Unlock", "(", ")", "\n", "for", "_", ",",...
// FindSecretKey will, given a list of KIDs, find the first one in the // list that has a corresponding secret key in the keyring file.
[ "FindSecretKey", "will", "given", "a", "list", "of", "KIDs", "find", "the", "first", "one", "in", "the", "list", "that", "has", "a", "corresponding", "secret", "key", "in", "the", "keyring", "file", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/skb_keyring.go#L332-L341
158,959
keybase/client
go/libkb/skb_keyring.go
WriteTo
func (k *SKBKeyringFile) WriteTo(w io.Writer) (n int64, err error) { k.G().Log.Debug("+ SKBKeyringFile WriteTo") defer k.G().Log.Debug("- SKBKeyringFile WriteTo") b64 := base64.NewEncoder(base64.StdEncoding, w) defer func() { // explicitly check for error on Close: if closeErr := b64.Close(); closeErr != nil { ...
go
func (k *SKBKeyringFile) WriteTo(w io.Writer) (n int64, err error) { k.G().Log.Debug("+ SKBKeyringFile WriteTo") defer k.G().Log.Debug("- SKBKeyringFile WriteTo") b64 := base64.NewEncoder(base64.StdEncoding, w) defer func() { // explicitly check for error on Close: if closeErr := b64.Close(); closeErr != nil { ...
[ "func", "(", "k", "*", "SKBKeyringFile", ")", "WriteTo", "(", "w", "io", ".", "Writer", ")", "(", "n", "int64", ",", "err", "error", ")", "{", "k", ".", "G", "(", ")", ".", "Log", ".", "Debug", "(", "\"", "\"", ")", "\n", "defer", "k", ".", ...
// WriteTo is similar to GetFilename described just above in terms of // locking discipline.
[ "WriteTo", "is", "similar", "to", "GetFilename", "described", "just", "above", "in", "terms", "of", "locking", "discipline", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/skb_keyring.go#L374-L397
158,960
keybase/client
go/client/cmd_chat_delete_history.go
parseAge
func (c *CmdChatDeleteHistory) parseAge(s string) (gregor1.DurationSec, string, error) { generalErr := fmt.Errorf("duration must be an integer and suffix [s,h,d,w,m] like: 10d") if len(s) < 2 { return 0, "", generalErr } factor := time.Second unitName := "" switch s[len(s)-1] { case 's': factor = time.Second...
go
func (c *CmdChatDeleteHistory) parseAge(s string) (gregor1.DurationSec, string, error) { generalErr := fmt.Errorf("duration must be an integer and suffix [s,h,d,w,m] like: 10d") if len(s) < 2 { return 0, "", generalErr } factor := time.Second unitName := "" switch s[len(s)-1] { case 's': factor = time.Second...
[ "func", "(", "c", "*", "CmdChatDeleteHistory", ")", "parseAge", "(", "s", "string", ")", "(", "gregor1", ".", "DurationSec", ",", "string", ",", "error", ")", "{", "generalErr", ":=", "fmt", ".", "Errorf", "(", "\"", "\"", ")", "\n", "if", "len", "("...
// Returns a duration and English string like "2 days".
[ "Returns", "a", "duration", "and", "English", "string", "like", "2", "days", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_chat_delete_history.go#L110-L154
158,961
keybase/client
go/client/cmd_chat_delete_history.go
chatSendDeleteHistory
func (c *CmdChatDeleteHistory) chatSendDeleteHistory(ctx context.Context) error { resolver, err := newChatConversationResolver(c.G()) if err != nil { return err } conversation, _, err := resolver.Resolve(ctx, c.resolvingRequest, chatConversationResolvingBehavior{ CreateIfNotExists: false, MustNotExist: ...
go
func (c *CmdChatDeleteHistory) chatSendDeleteHistory(ctx context.Context) error { resolver, err := newChatConversationResolver(c.G()) if err != nil { return err } conversation, _, err := resolver.Resolve(ctx, c.resolvingRequest, chatConversationResolvingBehavior{ CreateIfNotExists: false, MustNotExist: ...
[ "func", "(", "c", "*", "CmdChatDeleteHistory", ")", "chatSendDeleteHistory", "(", "ctx", "context", ".", "Context", ")", "error", "{", "resolver", ",", "err", ":=", "newChatConversationResolver", "(", "c", ".", "G", "(", ")", ")", "\n", "if", "err", "!=", ...
// Like chatSend but uses PostDeleteHistoryByAge.
[ "Like", "chatSend", "but", "uses", "PostDeleteHistoryByAge", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_chat_delete_history.go#L157-L200
158,962
keybase/client
go/libkb/link_cache.go
NewLinkCache
func NewLinkCache(maxSize int, cleanDur time.Duration) *LinkCache { c := &LinkCache{ cache: make(map[linkIDFixed]*list.Element), done: make(chan struct{}), maxSize: maxSize, cleanWait: cleanDur, accessOrder: list.New(), } go c.periodic() return c }
go
func NewLinkCache(maxSize int, cleanDur time.Duration) *LinkCache { c := &LinkCache{ cache: make(map[linkIDFixed]*list.Element), done: make(chan struct{}), maxSize: maxSize, cleanWait: cleanDur, accessOrder: list.New(), } go c.periodic() return c }
[ "func", "NewLinkCache", "(", "maxSize", "int", ",", "cleanDur", "time", ".", "Duration", ")", "*", "LinkCache", "{", "c", ":=", "&", "LinkCache", "{", "cache", ":", "make", "(", "map", "[", "linkIDFixed", "]", "*", "list", ".", "Element", ")", ",", "...
// NewLinkCache creates a LinkCache. When finished using this // LinkCache, call Shutdown on it to clean up.
[ "NewLinkCache", "creates", "a", "LinkCache", ".", "When", "finished", "using", "this", "LinkCache", "call", "Shutdown", "on", "it", "to", "clean", "up", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/link_cache.go#L32-L42
158,963
keybase/client
go/libkb/link_cache.go
Get
func (c *LinkCache) Get(id LinkID) (link ChainLink, ok bool) { c.Lock() defer c.Unlock() var linkID linkIDFixed copy(linkID[:], id) elt, ok := c.cache[linkID] if ok { link, ok := elt.Value.(ChainLink) if !ok { panic(fmt.Sprintf("invalid type in cache: %T", elt)) } // move the element to the back (most ...
go
func (c *LinkCache) Get(id LinkID) (link ChainLink, ok bool) { c.Lock() defer c.Unlock() var linkID linkIDFixed copy(linkID[:], id) elt, ok := c.cache[linkID] if ok { link, ok := elt.Value.(ChainLink) if !ok { panic(fmt.Sprintf("invalid type in cache: %T", elt)) } // move the element to the back (most ...
[ "func", "(", "c", "*", "LinkCache", ")", "Get", "(", "id", "LinkID", ")", "(", "link", "ChainLink", ",", "ok", "bool", ")", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n", "var", "linkID", "linkIDFixed", "\n", ...
// Get retrieves a ChainLink from the cache. If nothing // exists for this LinkID, it will return false for ok.
[ "Get", "retrieves", "a", "ChainLink", "from", "the", "cache", ".", "If", "nothing", "exists", "for", "this", "LinkID", "it", "will", "return", "false", "for", "ok", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/link_cache.go#L46-L62
158,964
keybase/client
go/libkb/link_cache.go
Remove
func (c *LinkCache) Remove(id LinkID) { c.Lock() defer c.Unlock() var linkID linkIDFixed copy(linkID[:], id) elt, ok := c.cache[linkID] if ok { c.accessOrder.Remove(elt) } delete(c.cache, linkID) }
go
func (c *LinkCache) Remove(id LinkID) { c.Lock() defer c.Unlock() var linkID linkIDFixed copy(linkID[:], id) elt, ok := c.cache[linkID] if ok { c.accessOrder.Remove(elt) } delete(c.cache, linkID) }
[ "func", "(", "c", "*", "LinkCache", ")", "Remove", "(", "id", "LinkID", ")", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n", "var", "linkID", "linkIDFixed", "\n", "copy", "(", "linkID", "[", ":", "]", ",", "i...
// Remove deletes a ChainLink from the cache.
[ "Remove", "deletes", "a", "ChainLink", "from", "the", "cache", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/link_cache.go#L96-L106
158,965
keybase/client
go/libkb/link_cache.go
Len
func (c *LinkCache) Len() int { c.Lock() defer c.Unlock() return len(c.cache) }
go
func (c *LinkCache) Len() int { c.Lock() defer c.Unlock() return len(c.cache) }
[ "func", "(", "c", "*", "LinkCache", ")", "Len", "(", ")", "int", "{", "c", ".", "Lock", "(", ")", "\n", "defer", "c", ".", "Unlock", "(", ")", "\n", "return", "len", "(", "c", ".", "cache", ")", "\n", "}" ]
// Len returns the number of ChainLinks cached.
[ "Len", "returns", "the", "number", "of", "ChainLinks", "cached", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/link_cache.go#L109-L113
158,966
keybase/client
go/engine/favorite_ignore.go
NewFavoriteIgnore
func NewFavoriteIgnore(g *libkb.GlobalContext, arg *keybase1.FavoriteIgnoreArg) *FavoriteIgnore { return &FavoriteIgnore{ arg: arg, Contextified: libkb.NewContextified(g), } }
go
func NewFavoriteIgnore(g *libkb.GlobalContext, arg *keybase1.FavoriteIgnoreArg) *FavoriteIgnore { return &FavoriteIgnore{ arg: arg, Contextified: libkb.NewContextified(g), } }
[ "func", "NewFavoriteIgnore", "(", "g", "*", "libkb", ".", "GlobalContext", ",", "arg", "*", "keybase1", ".", "FavoriteIgnoreArg", ")", "*", "FavoriteIgnore", "{", "return", "&", "FavoriteIgnore", "{", "arg", ":", "arg", ",", "Contextified", ":", "libkb", "."...
// NewFavoriteIgnore creates a FavoriteIgnore engine.
[ "NewFavoriteIgnore", "creates", "a", "FavoriteIgnore", "engine", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/favorite_ignore.go#L20-L25
158,967
keybase/client
go/protocol/gregor1/factory.go
Less
func (its itemSlice) Less(i, j int) bool { mI, mJ := its[i].Metadata(), its[j].Metadata() if mI != nil && mJ != nil { if mI.CTime().Equal(mJ.CTime()) { if mI.MsgID() != nil && mJ.MsgID() != nil { return bytes.Compare(mI.MsgID().Bytes(), mJ.MsgID().Bytes()) < 0 } else { return mI.MsgID() == nil } ...
go
func (its itemSlice) Less(i, j int) bool { mI, mJ := its[i].Metadata(), its[j].Metadata() if mI != nil && mJ != nil { if mI.CTime().Equal(mJ.CTime()) { if mI.MsgID() != nil && mJ.MsgID() != nil { return bytes.Compare(mI.MsgID().Bytes(), mJ.MsgID().Bytes()) < 0 } else { return mI.MsgID() == nil } ...
[ "func", "(", "its", "itemSlice", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "mI", ",", "mJ", ":=", "its", "[", "i", "]", ".", "Metadata", "(", ")", ",", "its", "[", "j", "]", ".", "Metadata", "(", ")", "\n", "if", "mI", "!=",...
// Less returns true if i's ctime is before j's, or if they're equal and // i's MsgID is lexicographically before j's.
[ "Less", "returns", "true", "if", "i", "s", "ctime", "is", "before", "j", "s", "or", "if", "they", "re", "equal", "and", "i", "s", "MsgID", "is", "lexicographically", "before", "j", "s", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/gregor1/factory.go#L189-L202
158,968
keybase/client
go/kbfs/libdokan/dir.go
isNoSuchNameError
func isNoSuchNameError(err error) bool { _, ok := err.(idutil.NoSuchNameError) return ok }
go
func isNoSuchNameError(err error) bool { _, ok := err.(idutil.NoSuchNameError) return ok }
[ "func", "isNoSuchNameError", "(", "err", "error", ")", "bool", "{", "_", ",", "ok", ":=", "err", ".", "(", "idutil", ".", "NoSuchNameError", ")", "\n", "return", "ok", "\n", "}" ]
// isNoSuchNameError checks for libkbfs.NoSuchNameError.
[ "isNoSuchNameError", "checks", "for", "libkbfs", ".", "NoSuchNameError", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/dir.go#L272-L275
158,969
keybase/client
go/kbfs/libdokan/dir.go
isSafeFolder
func isSafeFolder(ctx context.Context, f *Folder) bool { return libkbfs.IsOnlyWriterInNonTeamTlf(ctx, f.list.fs.config.KBPKI(), f.h) }
go
func isSafeFolder(ctx context.Context, f *Folder) bool { return libkbfs.IsOnlyWriterInNonTeamTlf(ctx, f.list.fs.config.KBPKI(), f.h) }
[ "func", "isSafeFolder", "(", "ctx", "context", ".", "Context", ",", "f", "*", "Folder", ")", "bool", "{", "return", "libkbfs", ".", "IsOnlyWriterInNonTeamTlf", "(", "ctx", ",", "f", ".", "list", ".", "fs", ".", "config", ".", "KBPKI", "(", ")", ",", ...
// isSafeFolder returns whether a Folder is considered safe.
[ "isSafeFolder", "returns", "whether", "a", "Folder", "is", "considered", "safe", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libdokan/dir.go#L286-L288
158,970
keybase/client
go/chat/active.go
TouchFirstChatActiveQueryTime
func TouchFirstChatActiveQueryTime(ctx context.Context, g *globals.Context, log utils.DebugLabeler) time.Time { now := time.Now() var firstQueryUnixTime int64 found, err := g.LocalChatDb.GetInto(&firstQueryUnixTime, firstQueryTimeDbKey()) // Warn for errors and bail. if err != nil { log.Debug(ctx, "Failed to get...
go
func TouchFirstChatActiveQueryTime(ctx context.Context, g *globals.Context, log utils.DebugLabeler) time.Time { now := time.Now() var firstQueryUnixTime int64 found, err := g.LocalChatDb.GetInto(&firstQueryUnixTime, firstQueryTimeDbKey()) // Warn for errors and bail. if err != nil { log.Debug(ctx, "Failed to get...
[ "func", "TouchFirstChatActiveQueryTime", "(", "ctx", "context", ".", "Context", ",", "g", "*", "globals", ".", "Context", ",", "log", "utils", ".", "DebugLabeler", ")", "time", ".", "Time", "{", "now", ":=", "time", ".", "Now", "(", ")", "\n", "var", "...
// If no first query time is found in the local db, this function writes the // current time.
[ "If", "no", "first", "query", "time", "is", "found", "in", "the", "local", "db", "this", "function", "writes", "the", "current", "time", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/active.go#L33-L55
158,971
keybase/client
go/chat/server.go
GetInboxAndUnboxLocal
func (h *Server) GetInboxAndUnboxLocal(ctx context.Context, arg chat1.GetInboxAndUnboxLocalArg) (res chat1.GetInboxAndUnboxLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) if arg.Query != nil && arg.Query.Topic...
go
func (h *Server) GetInboxAndUnboxLocal(ctx context.Context, arg chat1.GetInboxAndUnboxLocalArg) (res chat1.GetInboxAndUnboxLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) if arg.Query != nil && arg.Query.Topic...
[ "func", "(", "h", "*", "Server", ")", "GetInboxAndUnboxLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "GetInboxAndUnboxLocalArg", ")", "(", "res", "chat1", ".", "GetInboxAndUnboxLocalRes", ",", "err", "error", ")", "{", "var", "iden...
// GetInboxAndUnboxLocal implements keybase.chatLocal.getInboxAndUnboxLocal protocol.
[ "GetInboxAndUnboxLocal", "implements", "keybase", ".", "chatLocal", ".", "getInboxAndUnboxLocal", "protocol", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L384-L418
158,972
keybase/client
go/chat/server.go
GetThreadLocal
func (h *Server) GetThreadLocal(ctx context.Context, arg chat1.GetThreadLocalArg) (res chat1.GetThreadLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return err }, "GetThreadL...
go
func (h *Server) GetThreadLocal(ctx context.Context, arg chat1.GetThreadLocalArg) (res chat1.GetThreadLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return err }, "GetThreadL...
[ "func", "(", "h", "*", "Server", ")", "GetThreadLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "GetThreadLocalArg", ")", "(", "res", "chat1", ".", "GetThreadLocalRes", ",", "err", "error", ")", "{", "var", "identBreaks", "[", "]...
// GetThreadLocal implements keybase.chatLocal.getThreadLocal protocol.
[ "GetThreadLocal", "implements", "keybase", ".", "chatLocal", ".", "getThreadLocal", "protocol", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L486-L514
158,973
keybase/client
go/chat/server.go
NewConversationLocal
func (h *Server) NewConversationLocal(ctx context.Context, arg chat1.NewConversationLocalArg) (res chat1.NewConversationLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return ...
go
func (h *Server) NewConversationLocal(ctx context.Context, arg chat1.NewConversationLocalArg) (res chat1.NewConversationLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return ...
[ "func", "(", "h", "*", "Server", ")", "NewConversationLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "NewConversationLocalArg", ")", "(", "res", "chat1", ".", "NewConversationLocalRes", ",", "err", "error", ")", "{", "var", "identBr...
// NewConversationLocal implements keybase.chatLocal.newConversationLocal protocol. // Create a new conversation. Or in the case of CHAT, create-or-get a conversation.
[ "NewConversationLocal", "implements", "keybase", ".", "chatLocal", ".", "newConversationLocal", "protocol", ".", "Create", "a", "new", "conversation", ".", "Or", "in", "the", "case", "of", "CHAT", "create", "-", "or", "-", "get", "a", "conversation", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L889-L909
158,974
keybase/client
go/chat/server.go
PostLocal
func (h *Server) PostLocal(ctx context.Context, arg chat1.PostLocalArg) (res chat1.PostLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return err }, "PostLocal")() defer func...
go
func (h *Server) PostLocal(ctx context.Context, arg chat1.PostLocalArg) (res chat1.PostLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return err }, "PostLocal")() defer func...
[ "func", "(", "h", "*", "Server", ")", "PostLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "PostLocalArg", ")", "(", "res", "chat1", ".", "PostLocalRes", ",", "err", "error", ")", "{", "var", "identBreaks", "[", "]", "keybase1"...
// PostLocal implements keybase.chatLocal.postLocal protocol.
[ "PostLocal", "implements", "keybase", ".", "chatLocal", ".", "postLocal", "protocol", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1153-L1196
158,975
keybase/client
go/chat/server.go
MakePreview
func (h *Server) MakePreview(ctx context.Context, arg chat1.MakePreviewArg) (res chat1.MakePreviewRes, err error) { defer h.Trace(ctx, func() error { return err }, "MakePreview")() return attachments.NewSender(h.G()).MakePreview(ctx, arg.Filename, arg.OutboxID) }
go
func (h *Server) MakePreview(ctx context.Context, arg chat1.MakePreviewArg) (res chat1.MakePreviewRes, err error) { defer h.Trace(ctx, func() error { return err }, "MakePreview")() return attachments.NewSender(h.G()).MakePreview(ctx, arg.Filename, arg.OutboxID) }
[ "func", "(", "h", "*", "Server", ")", "MakePreview", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "MakePreviewArg", ")", "(", "res", "chat1", ".", "MakePreviewRes", ",", "err", "error", ")", "{", "defer", "h", ".", "Trace", "(", "...
// MakePreview implements chat1.LocalInterface.MakePreview.
[ "MakePreview", "implements", "chat1", ".", "LocalInterface", ".", "MakePreview", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1508-L1511
158,976
keybase/client
go/chat/server.go
PostFileAttachmentLocal
func (h *Server) PostFileAttachmentLocal(ctx context.Context, arg chat1.PostFileAttachmentLocalArg) (res chat1.PostLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.Arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return e...
go
func (h *Server) PostFileAttachmentLocal(ctx context.Context, arg chat1.PostFileAttachmentLocalArg) (res chat1.PostLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.Arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error { return e...
[ "func", "(", "h", "*", "Server", ")", "PostFileAttachmentLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "PostFileAttachmentLocalArg", ")", "(", "res", "chat1", ".", "PostLocalRes", ",", "err", "error", ")", "{", "var", "identBreaks"...
// PostFileAttachmentLocal implements chat1.LocalInterface.PostFileAttachmentLocal.
[ "PostFileAttachmentLocal", "implements", "chat1", ".", "LocalInterface", ".", "PostFileAttachmentLocal", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1558-L1584
158,977
keybase/client
go/chat/server.go
DownloadAttachmentLocal
func (h *Server) DownloadAttachmentLocal(ctx context.Context, arg chat1.DownloadAttachmentLocalArg) (res chat1.DownloadAttachmentLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error ...
go
func (h *Server) DownloadAttachmentLocal(ctx context.Context, arg chat1.DownloadAttachmentLocalArg) (res chat1.DownloadAttachmentLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, func() error ...
[ "func", "(", "h", "*", "Server", ")", "DownloadAttachmentLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "DownloadAttachmentLocalArg", ")", "(", "res", "chat1", ".", "DownloadAttachmentLocalRes", ",", "err", "error", ")", "{", "var", ...
// DownloadAttachmentLocal implements chat1.LocalInterface.DownloadAttachmentLocal.
[ "DownloadAttachmentLocal", "implements", "chat1", ".", "LocalInterface", ".", "DownloadAttachmentLocal", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1587-L1607
158,978
keybase/client
go/chat/server.go
DownloadFileAttachmentLocal
func (h *Server) DownloadFileAttachmentLocal(ctx context.Context, arg chat1.DownloadFileAttachmentLocalArg) (res chat1.DownloadFileAttachmentLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, f...
go
func (h *Server) DownloadFileAttachmentLocal(ctx context.Context, arg chat1.DownloadFileAttachmentLocalArg) (res chat1.DownloadFileAttachmentLocalRes, err error) { var identBreaks []keybase1.TLFIdentifyFailure ctx = globals.ChatCtx(ctx, h.G(), arg.IdentifyBehavior, &identBreaks, h.identNotifier) defer h.Trace(ctx, f...
[ "func", "(", "h", "*", "Server", ")", "DownloadFileAttachmentLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "DownloadFileAttachmentLocalArg", ")", "(", "res", "chat1", ".", "DownloadFileAttachmentLocalRes", ",", "err", "error", ")", "{"...
// DownloadFileAttachmentLocal implements chat1.LocalInterface.DownloadFileAttachmentLocal.
[ "DownloadFileAttachmentLocal", "implements", "chat1", ".", "LocalInterface", ".", "DownloadFileAttachmentLocal", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1610-L1649
158,979
keybase/client
go/chat/server.go
remoteClient
func (h *Server) remoteClient() chat1.RemoteInterface { if h.rc != nil { return h.rc } return h.serverConn.GetClient() }
go
func (h *Server) remoteClient() chat1.RemoteInterface { if h.rc != nil { return h.rc } return h.serverConn.GetClient() }
[ "func", "(", "h", "*", "Server", ")", "remoteClient", "(", ")", "chat1", ".", "RemoteInterface", "{", "if", "h", ".", "rc", "!=", "nil", "{", "return", "h", ".", "rc", "\n", "}", "\n", "return", "h", ".", "serverConn", ".", "GetClient", "(", ")", ...
// remoteClient returns a client connection to gregord.
[ "remoteClient", "returns", "a", "client", "connection", "to", "gregord", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1746-L1751
158,980
keybase/client
go/chat/server.go
deleteConversationLocal
func (h *Server) deleteConversationLocal(ctx context.Context, arg chat1.DeleteConversationLocalArg) (res chat1.DeleteConversationLocalRes, err error) { ui := h.getChatUI(arg.SessionID) confirmed := arg.Confirmed if !confirmed { confirmed, err = ui.ChatConfirmChannelDelete(ctx, chat1.ChatConfirmChannelDeleteArg{ ...
go
func (h *Server) deleteConversationLocal(ctx context.Context, arg chat1.DeleteConversationLocalArg) (res chat1.DeleteConversationLocalRes, err error) { ui := h.getChatUI(arg.SessionID) confirmed := arg.Confirmed if !confirmed { confirmed, err = ui.ChatConfirmChannelDelete(ctx, chat1.ChatConfirmChannelDeleteArg{ ...
[ "func", "(", "h", "*", "Server", ")", "deleteConversationLocal", "(", "ctx", "context", ".", "Context", ",", "arg", "chat1", ".", "DeleteConversationLocalArg", ")", "(", "res", "chat1", ".", "DeleteConversationLocalRes", ",", "err", "error", ")", "{", "ui", ...
// deleteConversationLocal contains the functionality of // DeleteConversationLocal split off for easier testing.
[ "deleteConversationLocal", "contains", "the", "functionality", "of", "DeleteConversationLocal", "split", "off", "for", "easier", "testing", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/server.go#L1945-L1967
158,981
keybase/client
go/logger/output_windows.go
parseControlCode
func (cw *ColorWriter) parseControlCode(p []byte) []byte { if p[0] == 'D' { cw.w.Write([]byte(fmt.Sprintf("\b"))) } return p[1:] }
go
func (cw *ColorWriter) parseControlCode(p []byte) []byte { if p[0] == 'D' { cw.w.Write([]byte(fmt.Sprintf("\b"))) } return p[1:] }
[ "func", "(", "cw", "*", "ColorWriter", ")", "parseControlCode", "(", "p", "[", "]", "byte", ")", "[", "]", "byte", "{", "if", "p", "[", "0", "]", "==", "'D'", "{", "cw", ".", "w", ".", "Write", "(", "[", "]", "byte", "(", "fmt", ".", "Sprintf...
// parseControlCode is for absorbing backspaces, which // caused junk to come out on the console, and whichever // other control code we're probably unprepared for
[ "parseControlCode", "is", "for", "absorbing", "backspaces", "which", "caused", "junk", "to", "come", "out", "on", "the", "console", "and", "whichever", "other", "control", "code", "we", "re", "probably", "unprepared", "for" ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/output_windows.go#L251-L256
158,982
keybase/client
go/logger/output_windows.go
SaveConsoleMode
func SaveConsoleMode() error { var err error consoleMode, err = getConsoleTextAttribute(os.Stdout.Fd()) return err }
go
func SaveConsoleMode() error { var err error consoleMode, err = getConsoleTextAttribute(os.Stdout.Fd()) return err }
[ "func", "SaveConsoleMode", "(", ")", "error", "{", "var", "err", "error", "\n", "consoleMode", ",", "err", "=", "getConsoleTextAttribute", "(", "os", ".", "Stdout", ".", "Fd", "(", ")", ")", "\n", "return", "err", "\n", "}" ]
// SaveConsoleMode records the current text attributes in a global, so // it can be restored later, in case nonstandard colors are expected.
[ "SaveConsoleMode", "records", "the", "current", "text", "attributes", "in", "a", "global", "so", "it", "can", "be", "restored", "later", "in", "case", "nonstandard", "colors", "are", "expected", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/output_windows.go#L279-L283
158,983
keybase/client
go/logger/output_windows.go
checkError
func checkError(r1, r2 uintptr, err error) error { // Windows APIs return non-zero to indicate success if r1 != 0 { return nil } // Return the error if provided, otherwise default to EINVAL if err != nil { return err } return syscall.EINVAL }
go
func checkError(r1, r2 uintptr, err error) error { // Windows APIs return non-zero to indicate success if r1 != 0 { return nil } // Return the error if provided, otherwise default to EINVAL if err != nil { return err } return syscall.EINVAL }
[ "func", "checkError", "(", "r1", ",", "r2", "uintptr", ",", "err", "error", ")", "error", "{", "// Windows APIs return non-zero to indicate success", "if", "r1", "!=", "0", "{", "return", "nil", "\n", "}", "\n\n", "// Return the error if provided, otherwise default to...
// checkError evaluates the results of a Windows API call and returns the error if it failed.
[ "checkError", "evaluates", "the", "results", "of", "a", "Windows", "API", "call", "and", "returns", "the", "error", "if", "it", "failed", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/output_windows.go#L294-L305
158,984
keybase/client
go/kbfs/libkbfs/kbpki_client.go
NewKBPKIClient
func NewKBPKIClient( serviceOwner keybaseServiceOwner, log logger.Logger) *KBPKIClient { return &KBPKIClient{serviceOwner, log} }
go
func NewKBPKIClient( serviceOwner keybaseServiceOwner, log logger.Logger) *KBPKIClient { return &KBPKIClient{serviceOwner, log} }
[ "func", "NewKBPKIClient", "(", "serviceOwner", "keybaseServiceOwner", ",", "log", "logger", ".", "Logger", ")", "*", "KBPKIClient", "{", "return", "&", "KBPKIClient", "{", "serviceOwner", ",", "log", "}", "\n", "}" ]
// NewKBPKIClient returns a new KBPKIClient with the given service.
[ "NewKBPKIClient", "returns", "a", "new", "KBPKIClient", "with", "the", "given", "service", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L38-L41
158,985
keybase/client
go/kbfs/libkbfs/kbpki_client.go
GetCurrentSession
func (k *KBPKIClient) GetCurrentSession(ctx context.Context) ( idutil.SessionInfo, error) { const sessionID = 0 return k.serviceOwner.KeybaseService().CurrentSession(ctx, sessionID) }
go
func (k *KBPKIClient) GetCurrentSession(ctx context.Context) ( idutil.SessionInfo, error) { const sessionID = 0 return k.serviceOwner.KeybaseService().CurrentSession(ctx, sessionID) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "GetCurrentSession", "(", "ctx", "context", ".", "Context", ")", "(", "idutil", ".", "SessionInfo", ",", "error", ")", "{", "const", "sessionID", "=", "0", "\n", "return", "k", ".", "serviceOwner", ".", "Keybase...
// GetCurrentSession implements the KBPKI interface for KBPKIClient.
[ "GetCurrentSession", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L44-L48
158,986
keybase/client
go/kbfs/libkbfs/kbpki_client.go
Identify
func (k *KBPKIClient) Identify( ctx context.Context, assertion, reason string, offline keybase1.OfflineAvailability) ( kbname.NormalizedUsername, keybase1.UserOrTeamID, error) { return k.serviceOwner.KeybaseService().Identify( ctx, assertion, reason, offline) }
go
func (k *KBPKIClient) Identify( ctx context.Context, assertion, reason string, offline keybase1.OfflineAvailability) ( kbname.NormalizedUsername, keybase1.UserOrTeamID, error) { return k.serviceOwner.KeybaseService().Identify( ctx, assertion, reason, offline) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "Identify", "(", "ctx", "context", ".", "Context", ",", "assertion", ",", "reason", "string", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "kbname", ".", "NormalizedUsername", ",", "keybase1", "...
// Identify implements the KBPKI interface for KBPKIClient.
[ "Identify", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L59-L65
158,987
keybase/client
go/kbfs/libkbfs/kbpki_client.go
NormalizeSocialAssertion
func (k *KBPKIClient) NormalizeSocialAssertion( ctx context.Context, assertion string) (keybase1.SocialAssertion, error) { return k.serviceOwner.KeybaseService().NormalizeSocialAssertion(ctx, assertion) }
go
func (k *KBPKIClient) NormalizeSocialAssertion( ctx context.Context, assertion string) (keybase1.SocialAssertion, error) { return k.serviceOwner.KeybaseService().NormalizeSocialAssertion(ctx, assertion) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "NormalizeSocialAssertion", "(", "ctx", "context", ".", "Context", ",", "assertion", "string", ")", "(", "keybase1", ".", "SocialAssertion", ",", "error", ")", "{", "return", "k", ".", "serviceOwner", ".", "KeybaseS...
// NormalizeSocialAssertion implements the KBPKI interface for KBPKIClient.
[ "NormalizeSocialAssertion", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L68-L71
158,988
keybase/client
go/kbfs/libkbfs/kbpki_client.go
ResolveImplicitTeam
func (k *KBPKIClient) ResolveImplicitTeam( ctx context.Context, assertions, suffix string, tlfType tlf.Type, offline keybase1.OfflineAvailability) ( idutil.ImplicitTeamInfo, error) { return k.serviceOwner.KeybaseService().ResolveIdentifyImplicitTeam( ctx, assertions, suffix, tlfType, false, "", offline) }
go
func (k *KBPKIClient) ResolveImplicitTeam( ctx context.Context, assertions, suffix string, tlfType tlf.Type, offline keybase1.OfflineAvailability) ( idutil.ImplicitTeamInfo, error) { return k.serviceOwner.KeybaseService().ResolveIdentifyImplicitTeam( ctx, assertions, suffix, tlfType, false, "", offline) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "ResolveImplicitTeam", "(", "ctx", "context", ".", "Context", ",", "assertions", ",", "suffix", "string", ",", "tlfType", "tlf", ".", "Type", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "idutil...
// ResolveImplicitTeam implements the KBPKI interface for KBPKIClient.
[ "ResolveImplicitTeam", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L74-L80
158,989
keybase/client
go/kbfs/libkbfs/kbpki_client.go
ResolveImplicitTeamByID
func (k *KBPKIClient) ResolveImplicitTeamByID( ctx context.Context, teamID keybase1.TeamID, tlfType tlf.Type, offline keybase1.OfflineAvailability) ( idutil.ImplicitTeamInfo, error) { name, err := k.serviceOwner.KeybaseService().ResolveImplicitTeamByID( ctx, teamID) if err != nil { return idutil.ImplicitTeamIn...
go
func (k *KBPKIClient) ResolveImplicitTeamByID( ctx context.Context, teamID keybase1.TeamID, tlfType tlf.Type, offline keybase1.OfflineAvailability) ( idutil.ImplicitTeamInfo, error) { name, err := k.serviceOwner.KeybaseService().ResolveImplicitTeamByID( ctx, teamID) if err != nil { return idutil.ImplicitTeamIn...
[ "func", "(", "k", "*", "KBPKIClient", ")", "ResolveImplicitTeamByID", "(", "ctx", "context", ".", "Context", ",", "teamID", "keybase1", ".", "TeamID", ",", "tlfType", "tlf", ".", "Type", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "idut...
// ResolveImplicitTeamByID implements the KBPKI interface for KBPKIClient.
[ "ResolveImplicitTeamByID", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L83-L100
158,990
keybase/client
go/kbfs/libkbfs/kbpki_client.go
ResolveTeamTLFID
func (k *KBPKIClient) ResolveTeamTLFID( ctx context.Context, teamID keybase1.TeamID, offline keybase1.OfflineAvailability) (tlf.ID, error) { settings, err := k.serviceOwner.KeybaseService().GetTeamSettings( ctx, teamID, offline) if err != nil { return tlf.NullID, err } if settings.TlfID.IsNil() { return tlf...
go
func (k *KBPKIClient) ResolveTeamTLFID( ctx context.Context, teamID keybase1.TeamID, offline keybase1.OfflineAvailability) (tlf.ID, error) { settings, err := k.serviceOwner.KeybaseService().GetTeamSettings( ctx, teamID, offline) if err != nil { return tlf.NullID, err } if settings.TlfID.IsNil() { return tlf...
[ "func", "(", "k", "*", "KBPKIClient", ")", "ResolveTeamTLFID", "(", "ctx", "context", ".", "Context", ",", "teamID", "keybase1", ".", "TeamID", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "tlf", ".", "ID", ",", "error", ")", "{", "s...
// ResolveTeamTLFID implements the KBPKI interface for KBPKIClient.
[ "ResolveTeamTLFID", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L103-L119
158,991
keybase/client
go/kbfs/libkbfs/kbpki_client.go
GetNormalizedUsername
func (k *KBPKIClient) GetNormalizedUsername( ctx context.Context, id keybase1.UserOrTeamID, offline keybase1.OfflineAvailability) ( kbname.NormalizedUsername, error) { var assertion string if id.IsUser() { assertion = fmt.Sprintf("uid:%s", id) } else { assertion = fmt.Sprintf("tid:%s", id) } username, _, er...
go
func (k *KBPKIClient) GetNormalizedUsername( ctx context.Context, id keybase1.UserOrTeamID, offline keybase1.OfflineAvailability) ( kbname.NormalizedUsername, error) { var assertion string if id.IsUser() { assertion = fmt.Sprintf("uid:%s", id) } else { assertion = fmt.Sprintf("tid:%s", id) } username, _, er...
[ "func", "(", "k", "*", "KBPKIClient", ")", "GetNormalizedUsername", "(", "ctx", "context", ".", "Context", ",", "id", "keybase1", ".", "UserOrTeamID", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "kbname", ".", "NormalizedUsername", ",", "...
// GetNormalizedUsername implements the KBPKI interface for // KBPKIClient.
[ "GetNormalizedUsername", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L133-L148
158,992
keybase/client
go/kbfs/libkbfs/kbpki_client.go
HasVerifyingKey
func (k *KBPKIClient) HasVerifyingKey( ctx context.Context, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, atServerTime time.Time, offline keybase1.OfflineAvailability) error { ok, err := k.hasVerifyingKey(ctx, uid, verifyingKey, atServerTime, offline) if err != nil { return err } if ok { return nil ...
go
func (k *KBPKIClient) HasVerifyingKey( ctx context.Context, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, atServerTime time.Time, offline keybase1.OfflineAvailability) error { ok, err := k.hasVerifyingKey(ctx, uid, verifyingKey, atServerTime, offline) if err != nil { return err } if ok { return nil ...
[ "func", "(", "k", "*", "KBPKIClient", ")", "HasVerifyingKey", "(", "ctx", "context", ".", "Context", ",", "uid", "keybase1", ".", "UID", ",", "verifyingKey", "kbfscrypto", ".", "VerifyingKey", ",", "atServerTime", "time", ".", "Time", ",", "offline", "keybas...
// HasVerifyingKey implements the KBPKI interface for KBPKIClient.
[ "HasVerifyingKey", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L192-L216
158,993
keybase/client
go/kbfs/libkbfs/kbpki_client.go
GetCryptPublicKeys
func (k *KBPKIClient) GetCryptPublicKeys( ctx context.Context, uid keybase1.UID, offline keybase1.OfflineAvailability) ( keys []kbfscrypto.CryptPublicKey, err error) { userInfo, err := k.loadUserPlusKeys(ctx, uid, "", offline) if err != nil { return nil, err } return userInfo.CryptPublicKeys, nil }
go
func (k *KBPKIClient) GetCryptPublicKeys( ctx context.Context, uid keybase1.UID, offline keybase1.OfflineAvailability) ( keys []kbfscrypto.CryptPublicKey, err error) { userInfo, err := k.loadUserPlusKeys(ctx, uid, "", offline) if err != nil { return nil, err } return userInfo.CryptPublicKeys, nil }
[ "func", "(", "k", "*", "KBPKIClient", ")", "GetCryptPublicKeys", "(", "ctx", "context", ".", "Context", ",", "uid", "keybase1", ".", "UID", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "keys", "[", "]", "kbfscrypto", ".", "CryptPublicKey...
// GetCryptPublicKeys implements the KBPKI interface for KBPKIClient.
[ "GetCryptPublicKeys", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L226-L235
158,994
keybase/client
go/kbfs/libkbfs/kbpki_client.go
GetTeamTLFCryptKeys
func (k *KBPKIClient) GetTeamTLFCryptKeys( ctx context.Context, tid keybase1.TeamID, desiredKeyGen kbfsmd.KeyGen, offline keybase1.OfflineAvailability) ( map[kbfsmd.KeyGen]kbfscrypto.TLFCryptKey, kbfsmd.KeyGen, error) { teamInfo, err := k.serviceOwner.KeybaseService().LoadTeamPlusKeys( ctx, tid, tlf.Unknown, desi...
go
func (k *KBPKIClient) GetTeamTLFCryptKeys( ctx context.Context, tid keybase1.TeamID, desiredKeyGen kbfsmd.KeyGen, offline keybase1.OfflineAvailability) ( map[kbfsmd.KeyGen]kbfscrypto.TLFCryptKey, kbfsmd.KeyGen, error) { teamInfo, err := k.serviceOwner.KeybaseService().LoadTeamPlusKeys( ctx, tid, tlf.Unknown, desi...
[ "func", "(", "k", "*", "KBPKIClient", ")", "GetTeamTLFCryptKeys", "(", "ctx", "context", ".", "Context", ",", "tid", "keybase1", ".", "TeamID", ",", "desiredKeyGen", "kbfsmd", ".", "KeyGen", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "...
// GetTeamTLFCryptKeys implements the KBPKI interface for KBPKIClient.
[ "GetTeamTLFCryptKeys", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L238-L249
158,995
keybase/client
go/kbfs/libkbfs/kbpki_client.go
GetCurrentMerkleRoot
func (k *KBPKIClient) GetCurrentMerkleRoot(ctx context.Context) ( keybase1.MerkleRootV2, time.Time, error) { return k.serviceOwner.KeybaseService().GetCurrentMerkleRoot(ctx) }
go
func (k *KBPKIClient) GetCurrentMerkleRoot(ctx context.Context) ( keybase1.MerkleRootV2, time.Time, error) { return k.serviceOwner.KeybaseService().GetCurrentMerkleRoot(ctx) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "GetCurrentMerkleRoot", "(", "ctx", "context", ".", "Context", ")", "(", "keybase1", ".", "MerkleRootV2", ",", "time", ".", "Time", ",", "error", ")", "{", "return", "k", ".", "serviceOwner", ".", "KeybaseService"...
// GetCurrentMerkleRoot implements the KBPKI interface for KBPKIClient.
[ "GetCurrentMerkleRoot", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L252-L255
158,996
keybase/client
go/kbfs/libkbfs/kbpki_client.go
VerifyMerkleRoot
func (k *KBPKIClient) VerifyMerkleRoot( ctx context.Context, root keybase1.MerkleRootV2, kbfsRoot keybase1.KBFSRoot) error { return k.serviceOwner.KeybaseService().VerifyMerkleRoot( ctx, root, kbfsRoot) }
go
func (k *KBPKIClient) VerifyMerkleRoot( ctx context.Context, root keybase1.MerkleRootV2, kbfsRoot keybase1.KBFSRoot) error { return k.serviceOwner.KeybaseService().VerifyMerkleRoot( ctx, root, kbfsRoot) }
[ "func", "(", "k", "*", "KBPKIClient", ")", "VerifyMerkleRoot", "(", "ctx", "context", ".", "Context", ",", "root", "keybase1", ".", "MerkleRootV2", ",", "kbfsRoot", "keybase1", ".", "KBFSRoot", ")", "error", "{", "return", "k", ".", "serviceOwner", ".", "K...
// VerifyMerkleRoot implements the KBPKI interface for KBPKIClient.
[ "VerifyMerkleRoot", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L258-L263
158,997
keybase/client
go/kbfs/libkbfs/kbpki_client.go
IsTeamWriter
func (k *KBPKIClient) IsTeamWriter( ctx context.Context, tid keybase1.TeamID, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, offline keybase1.OfflineAvailability) (bool, error) { if uid.IsNil() || verifyingKey.IsNil() { // A sessionless user can never be a writer. return false, nil } // Use the veri...
go
func (k *KBPKIClient) IsTeamWriter( ctx context.Context, tid keybase1.TeamID, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, offline keybase1.OfflineAvailability) (bool, error) { if uid.IsNil() || verifyingKey.IsNil() { // A sessionless user can never be a writer. return false, nil } // Use the veri...
[ "func", "(", "k", "*", "KBPKIClient", ")", "IsTeamWriter", "(", "ctx", "context", ".", "Context", ",", "tid", "keybase1", ".", "TeamID", ",", "uid", "keybase1", ".", "UID", ",", "verifyingKey", "kbfscrypto", ".", "VerifyingKey", ",", "offline", "keybase1", ...
// IsTeamWriter implements the KBPKI interface for KBPKIClient.
[ "IsTeamWriter", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L266-L324
158,998
keybase/client
go/kbfs/libkbfs/kbpki_client.go
NoLongerTeamWriter
func (k *KBPKIClient) NoLongerTeamWriter( ctx context.Context, tid keybase1.TeamID, tlfType tlf.Type, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, offline keybase1.OfflineAvailability) (keybase1.MerkleRootV2, error) { if uid.IsNil() || verifyingKey.IsNil() { // A sessionless user can never be a writer....
go
func (k *KBPKIClient) NoLongerTeamWriter( ctx context.Context, tid keybase1.TeamID, tlfType tlf.Type, uid keybase1.UID, verifyingKey kbfscrypto.VerifyingKey, offline keybase1.OfflineAvailability) (keybase1.MerkleRootV2, error) { if uid.IsNil() || verifyingKey.IsNil() { // A sessionless user can never be a writer....
[ "func", "(", "k", "*", "KBPKIClient", ")", "NoLongerTeamWriter", "(", "ctx", "context", ".", "Context", ",", "tid", "keybase1", ".", "TeamID", ",", "tlfType", "tlf", ".", "Type", ",", "uid", "keybase1", ".", "UID", ",", "verifyingKey", "kbfscrypto", ".", ...
// NoLongerTeamWriter implements the KBPKI interface for KBPKIClient.
[ "NoLongerTeamWriter", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L327-L349
158,999
keybase/client
go/kbfs/libkbfs/kbpki_client.go
IsTeamReader
func (k *KBPKIClient) IsTeamReader( ctx context.Context, tid keybase1.TeamID, uid keybase1.UID, offline keybase1.OfflineAvailability) (bool, error) { desiredUser := keybase1.UserVersion{Uid: uid} teamInfo, err := k.serviceOwner.KeybaseService().LoadTeamPlusKeys( ctx, tid, tlf.Unknown, kbfsmd.UnspecifiedKeyGen, de...
go
func (k *KBPKIClient) IsTeamReader( ctx context.Context, tid keybase1.TeamID, uid keybase1.UID, offline keybase1.OfflineAvailability) (bool, error) { desiredUser := keybase1.UserVersion{Uid: uid} teamInfo, err := k.serviceOwner.KeybaseService().LoadTeamPlusKeys( ctx, tid, tlf.Unknown, kbfsmd.UnspecifiedKeyGen, de...
[ "func", "(", "k", "*", "KBPKIClient", ")", "IsTeamReader", "(", "ctx", "context", ".", "Context", ",", "tid", "keybase1", ".", "TeamID", ",", "uid", "keybase1", ".", "UID", ",", "offline", "keybase1", ".", "OfflineAvailability", ")", "(", "bool", ",", "e...
// IsTeamReader implements the KBPKI interface for KBPKIClient.
[ "IsTeamReader", "implements", "the", "KBPKI", "interface", "for", "KBPKIClient", "." ]
b352622cd8cc94798cfacbcb56ada203c18e519e
https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/kbpki_client.go#L352-L363