id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
159,800 | keybase/client | go/teams/loader.go | NewTeamLoaderAndInstall | func NewTeamLoaderAndInstall(g *libkb.GlobalContext) *TeamLoader {
world := NewLoaderContextFromG(g)
st := NewStorage(g)
l := NewTeamLoader(g, world, st)
g.SetTeamLoader(l)
g.AddLogoutHook(l, "teamLoader")
g.AddDbNukeHook(l, "teamLoader")
return l
} | go | func NewTeamLoaderAndInstall(g *libkb.GlobalContext) *TeamLoader {
world := NewLoaderContextFromG(g)
st := NewStorage(g)
l := NewTeamLoader(g, world, st)
g.SetTeamLoader(l)
g.AddLogoutHook(l, "teamLoader")
g.AddDbNukeHook(l, "teamLoader")
return l
} | [
"func",
"NewTeamLoaderAndInstall",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
")",
"*",
"TeamLoader",
"{",
"world",
":=",
"NewLoaderContextFromG",
"(",
"g",
")",
"\n",
"st",
":=",
"NewStorage",
"(",
"g",
")",
"\n",
"l",
":=",
"NewTeamLoader",
"(",
"g",
... | // NewTeamLoaderAndInstall creates a new loader and installs it into G. | [
"NewTeamLoaderAndInstall",
"creates",
"a",
"new",
"loader",
"and",
"installs",
"it",
"into",
"G",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L93-L101 |
159,801 | keybase/client | go/teams/loader.go | ResolveNameToIDUntrusted | func (l *TeamLoader) ResolveNameToIDUntrusted(ctx context.Context, teamName keybase1.TeamName, public bool, allowCache bool) (id keybase1.TeamID, err error) {
defer l.G().CVTrace(ctx, libkb.VLog0, fmt.Sprintf("resolveNameToUIDUntrusted(%s,%v,%v)", teamName.String(), public, allowCache), func() error { return err })()... | go | func (l *TeamLoader) ResolveNameToIDUntrusted(ctx context.Context, teamName keybase1.TeamName, public bool, allowCache bool) (id keybase1.TeamID, err error) {
defer l.G().CVTrace(ctx, libkb.VLog0, fmt.Sprintf("resolveNameToUIDUntrusted(%s,%v,%v)", teamName.String(), public, allowCache), func() error { return err })()... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"ResolveNameToIDUntrusted",
"(",
"ctx",
"context",
".",
"Context",
",",
"teamName",
"keybase1",
".",
"TeamName",
",",
"public",
"bool",
",",
"allowCache",
"bool",
")",
"(",
"id",
"keybase1",
".",
"TeamID",
",",
"er... | // Resolve a team name to a team ID.
// Will always hit the server for subteams. The server can lie in this return value. | [
"Resolve",
"a",
"team",
"name",
"to",
"a",
"team",
"ID",
".",
"Will",
"always",
"hit",
"the",
"server",
"for",
"subteams",
".",
"The",
"server",
"can",
"lie",
"in",
"this",
"return",
"value",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L158-L183 |
159,802 | keybase/client | go/teams/loader.go | load2 | func (l *TeamLoader) load2(ctx context.Context, arg load2ArgT) (ret *load2ResT, err error) {
ctx = libkb.WithLogTag(ctx, "LT") // Load team
if arg.reason != "" {
ctx = libkb.WithLogTag(ctx, "LT2") // Load team recursive
}
traceLabel := fmt.Sprintf("TeamLoader#load2(%v, public:%v)", arg.teamID, arg.public)
if len... | go | func (l *TeamLoader) load2(ctx context.Context, arg load2ArgT) (ret *load2ResT, err error) {
ctx = libkb.WithLogTag(ctx, "LT") // Load team
if arg.reason != "" {
ctx = libkb.WithLogTag(ctx, "LT2") // Load team recursive
}
traceLabel := fmt.Sprintf("TeamLoader#load2(%v, public:%v)", arg.teamID, arg.public)
if len... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"load2",
"(",
"ctx",
"context",
".",
"Context",
",",
"arg",
"load2ArgT",
")",
"(",
"ret",
"*",
"load2ResT",
",",
"err",
"error",
")",
"{",
"ctx",
"=",
"libkb",
".",
"WithLogTag",
"(",
"ctx",
",",
"\"",
"\""... | // Load2 does the rest of the work loading a team.
// It is `playchain` described in the pseudocode in teamplayer.txt | [
"Load2",
"does",
"the",
"rest",
"of",
"the",
"work",
"loading",
"a",
"team",
".",
"It",
"is",
"playchain",
"described",
"in",
"the",
"pseudocode",
"in",
"teamplayer",
".",
"txt"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L386-L399 |
159,803 | keybase/client | go/teams/loader.go | userPreload | func (l *TeamLoader) userPreload(ctx context.Context, links []*ChainLinkUnpacked, fullVerifyCutoff keybase1.Seqno) (cancel func()) {
ctx, cancel = context.WithCancel(ctx)
if teamEnv.UserPreloadEnable {
uidSet := make(map[keybase1.UID]struct{})
for _, link := range links {
// fullVerify definition copied from v... | go | func (l *TeamLoader) userPreload(ctx context.Context, links []*ChainLinkUnpacked, fullVerifyCutoff keybase1.Seqno) (cancel func()) {
ctx, cancel = context.WithCancel(ctx)
if teamEnv.UserPreloadEnable {
uidSet := make(map[keybase1.UID]struct{})
for _, link := range links {
// fullVerify definition copied from v... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"userPreload",
"(",
"ctx",
"context",
".",
"Context",
",",
"links",
"[",
"]",
"*",
"ChainLinkUnpacked",
",",
"fullVerifyCutoff",
"keybase1",
".",
"Seqno",
")",
"(",
"cancel",
"func",
"(",
")",
")",
"{",
"ctx",
... | // userPreload warms the upak cache with users who will probably need to be loaded to verify the chain.
// Uses teamEnv and may be disabled. | [
"userPreload",
"warms",
"the",
"upak",
"cache",
"with",
"users",
"who",
"will",
"probably",
"need",
"to",
"be",
"loaded",
"to",
"verify",
"the",
"chain",
".",
"Uses",
"teamEnv",
"and",
"may",
"be",
"disabled",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L820-L862 |
159,804 | keybase/client | go/teams/loader.go | satisfiesNeedAdmin | func (l *TeamLoader) satisfiesNeedAdmin(ctx context.Context, me keybase1.UserVersion, teamData *keybase1.TeamData) bool {
if teamData == nil {
return false
}
if (TeamSigChainState{inner: teamData.Chain}.HasAnyStubbedLinks()) {
return false
}
if !l.hasSyncedSecrets(teamData) {
return false
}
state := TeamSi... | go | func (l *TeamLoader) satisfiesNeedAdmin(ctx context.Context, me keybase1.UserVersion, teamData *keybase1.TeamData) bool {
if teamData == nil {
return false
}
if (TeamSigChainState{inner: teamData.Chain}.HasAnyStubbedLinks()) {
return false
}
if !l.hasSyncedSecrets(teamData) {
return false
}
state := TeamSi... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"satisfiesNeedAdmin",
"(",
"ctx",
"context",
".",
"Context",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"teamData",
"*",
"keybase1",
".",
"TeamData",
")",
"bool",
"{",
"if",
"teamData",
"==",
"nil",
"{",
"re... | // Whether the user is an admin at the snapshot, and there are no stubbed links, and keys are up to date. | [
"Whether",
"the",
"user",
"is",
"an",
"admin",
"at",
"the",
"snapshot",
"and",
"there",
"are",
"no",
"stubbed",
"links",
"and",
"keys",
"are",
"up",
"to",
"date",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1027-L1057 |
159,805 | keybase/client | go/teams/loader.go | isImplicitAdminOf | func (l *TeamLoader) isImplicitAdminOf(ctx context.Context, teamID keybase1.TeamID, ancestorID *keybase1.TeamID,
me keybase1.UserVersion, uv keybase1.UserVersion) (bool, error) {
// IDs of ancestors that were not freshly polled.
// Check them again with forceRepoll if the affirmative is not found cached.
checkAgai... | go | func (l *TeamLoader) isImplicitAdminOf(ctx context.Context, teamID keybase1.TeamID, ancestorID *keybase1.TeamID,
me keybase1.UserVersion, uv keybase1.UserVersion) (bool, error) {
// IDs of ancestors that were not freshly polled.
// Check them again with forceRepoll if the affirmative is not found cached.
checkAgai... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"isImplicitAdminOf",
"(",
"ctx",
"context",
".",
"Context",
",",
"teamID",
"keybase1",
".",
"TeamID",
",",
"ancestorID",
"*",
"keybase1",
".",
"TeamID",
",",
"me",
"keybase1",
".",
"UserVersion",
",",
"uv",
"keybas... | // Check whether a user is an implicit admin of a team. | [
"Check",
"whether",
"a",
"user",
"is",
"an",
"implicit",
"admin",
"of",
"a",
"team",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1060-L1134 |
159,806 | keybase/client | go/teams/loader.go | satisfiesNeedKeyGeneration | func (l *TeamLoader) satisfiesNeedKeyGeneration(ctx context.Context, needKeyGeneration keybase1.PerTeamKeyGeneration, state *keybase1.TeamData) error {
if needKeyGeneration == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team does not contain key generation: %v", needKeyGeneration)
}
key, err := T... | go | func (l *TeamLoader) satisfiesNeedKeyGeneration(ctx context.Context, needKeyGeneration keybase1.PerTeamKeyGeneration, state *keybase1.TeamData) error {
if needKeyGeneration == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team does not contain key generation: %v", needKeyGeneration)
}
key, err := T... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"satisfiesNeedKeyGeneration",
"(",
"ctx",
"context",
".",
"Context",
",",
"needKeyGeneration",
"keybase1",
".",
"PerTeamKeyGeneration",
",",
"state",
"*",
"keybase1",
".",
"TeamData",
")",
"error",
"{",
"if",
"needKeyGen... | // Whether the snapshot has loaded at least up to the key generation and has the secret. | [
"Whether",
"the",
"snapshot",
"has",
"loaded",
"at",
"least",
"up",
"to",
"the",
"key",
"generation",
"and",
"has",
"the",
"secret",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1156-L1175 |
159,807 | keybase/client | go/teams/loader.go | satisfiesNeedApplicationsAtGenerations | func (l *TeamLoader) satisfiesNeedApplicationsAtGenerations(ctx context.Context,
needApplicationsAtGenerations map[keybase1.PerTeamKeyGeneration][]keybase1.TeamApplication, state *keybase1.TeamData) error {
if len(needApplicationsAtGenerations) == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team d... | go | func (l *TeamLoader) satisfiesNeedApplicationsAtGenerations(ctx context.Context,
needApplicationsAtGenerations map[keybase1.PerTeamKeyGeneration][]keybase1.TeamApplication, state *keybase1.TeamData) error {
if len(needApplicationsAtGenerations) == 0 {
return nil
}
if state == nil {
return fmt.Errorf("nil team d... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"satisfiesNeedApplicationsAtGenerations",
"(",
"ctx",
"context",
".",
"Context",
",",
"needApplicationsAtGenerations",
"map",
"[",
"keybase1",
".",
"PerTeamKeyGeneration",
"]",
"[",
"]",
"keybase1",
".",
"TeamApplication",
"... | // Whether the snapshot has loaded the reader key masks and key generations we
// need. | [
"Whether",
"the",
"snapshot",
"has",
"loaded",
"the",
"reader",
"key",
"masks",
"and",
"key",
"generations",
"we",
"need",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1179-L1195 |
159,808 | keybase/client | go/teams/loader.go | satisfiesWantMembers | func (l *TeamLoader) satisfiesWantMembers(ctx context.Context,
wantMembers []keybase1.UserVersion, wantMembersRole keybase1.TeamRole, state *keybase1.TeamData) error {
if wantMembersRole == keybase1.TeamRole_NONE {
// Default to writer.
wantMembersRole = keybase1.TeamRole_WRITER
}
if len(wantMembers) == 0 {
... | go | func (l *TeamLoader) satisfiesWantMembers(ctx context.Context,
wantMembers []keybase1.UserVersion, wantMembersRole keybase1.TeamRole, state *keybase1.TeamData) error {
if wantMembersRole == keybase1.TeamRole_NONE {
// Default to writer.
wantMembersRole = keybase1.TeamRole_WRITER
}
if len(wantMembers) == 0 {
... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"satisfiesWantMembers",
"(",
"ctx",
"context",
".",
"Context",
",",
"wantMembers",
"[",
"]",
"keybase1",
".",
"UserVersion",
",",
"wantMembersRole",
"keybase1",
".",
"TeamRole",
",",
"state",
"*",
"keybase1",
".",
"T... | // Whether the snapshot has each of `wantMembers` as a member. | [
"Whether",
"the",
"snapshot",
"has",
"each",
"of",
"wantMembers",
"as",
"a",
"member",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1218-L1241 |
159,809 | keybase/client | go/teams/loader.go | seqnosContains | func (l *TeamLoader) seqnosContains(xs []keybase1.Seqno, y keybase1.Seqno) bool {
for _, x := range xs {
if x.Eq(y) {
return true
}
}
return false
} | go | func (l *TeamLoader) seqnosContains(xs []keybase1.Seqno, y keybase1.Seqno) bool {
for _, x := range xs {
if x.Eq(y) {
return true
}
}
return false
} | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"seqnosContains",
"(",
"xs",
"[",
"]",
"keybase1",
".",
"Seqno",
",",
"y",
"keybase1",
".",
"Seqno",
")",
"bool",
"{",
"for",
"_",
",",
"x",
":=",
"range",
"xs",
"{",
"if",
"x",
".",
"Eq",
"(",
"y",
")"... | // Whether y is in xs. | [
"Whether",
"y",
"is",
"in",
"xs",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1261-L1268 |
159,810 | keybase/client | go/teams/loader.go | seqnosMax | func (l *TeamLoader) seqnosMax(seqnos []keybase1.Seqno) (ret keybase1.Seqno) {
for _, x := range seqnos {
if x > ret {
ret = x
}
}
return ret
} | go | func (l *TeamLoader) seqnosMax(seqnos []keybase1.Seqno) (ret keybase1.Seqno) {
for _, x := range seqnos {
if x > ret {
ret = x
}
}
return ret
} | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"seqnosMax",
"(",
"seqnos",
"[",
"]",
"keybase1",
".",
"Seqno",
")",
"(",
"ret",
"keybase1",
".",
"Seqno",
")",
"{",
"for",
"_",
",",
"x",
":=",
"range",
"seqnos",
"{",
"if",
"x",
">",
"ret",
"{",
"ret",
... | // Return the max in a list of positive seqnos. Returns 0 if the list is empty | [
"Return",
"the",
"max",
"in",
"a",
"list",
"of",
"positive",
"seqnos",
".",
"Returns",
"0",
"if",
"the",
"list",
"is",
"empty"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1271-L1278 |
159,811 | keybase/client | go/teams/loader.go | isFresh | func (l *TeamLoader) isFresh(ctx context.Context, cachedAt keybase1.Time) bool {
if cachedAt.IsZero() {
// This should never happen.
l.G().Log.CWarningf(ctx, "TeamLoader encountered zero cached time")
return false
}
diff := l.G().Clock().Now().Sub(cachedAt.Time())
fresh := (diff <= freshnessLimit)
if !fresh ... | go | func (l *TeamLoader) isFresh(ctx context.Context, cachedAt keybase1.Time) bool {
if cachedAt.IsZero() {
// This should never happen.
l.G().Log.CWarningf(ctx, "TeamLoader encountered zero cached time")
return false
}
diff := l.G().Clock().Now().Sub(cachedAt.Time())
fresh := (diff <= freshnessLimit)
if !fresh ... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"isFresh",
"(",
"ctx",
"context",
".",
"Context",
",",
"cachedAt",
"keybase1",
".",
"Time",
")",
"bool",
"{",
"if",
"cachedAt",
".",
"IsZero",
"(",
")",
"{",
"// This should never happen.",
"l",
".",
"G",
"(",
... | // Whether a TeamData from the cache is fresh. | [
"Whether",
"a",
"TeamData",
"from",
"the",
"cache",
"is",
"fresh",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1281-L1293 |
159,812 | keybase/client | go/teams/loader.go | hasSyncedSecrets | func (l *TeamLoader) hasSyncedSecrets(state *keybase1.TeamData) bool {
onChainGen := keybase1.PerTeamKeyGeneration(len(state.Chain.PerTeamKeys))
offChainGen := keybase1.PerTeamKeyGeneration(len(state.PerTeamKeySeedsUnverified))
return onChainGen == offChainGen
} | go | func (l *TeamLoader) hasSyncedSecrets(state *keybase1.TeamData) bool {
onChainGen := keybase1.PerTeamKeyGeneration(len(state.Chain.PerTeamKeys))
offChainGen := keybase1.PerTeamKeyGeneration(len(state.PerTeamKeySeedsUnverified))
return onChainGen == offChainGen
} | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"hasSyncedSecrets",
"(",
"state",
"*",
"keybase1",
".",
"TeamData",
")",
"bool",
"{",
"onChainGen",
":=",
"keybase1",
".",
"PerTeamKeyGeneration",
"(",
"len",
"(",
"state",
".",
"Chain",
".",
"PerTeamKeys",
")",
")... | // Whether the teams secrets are synced to the same point as its sigchain
// Does not check RKMs. | [
"Whether",
"the",
"teams",
"secrets",
"are",
"synced",
"to",
"the",
"same",
"point",
"as",
"its",
"sigchain",
"Does",
"not",
"check",
"RKMs",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1297-L1301 |
159,813 | keybase/client | go/teams/loader.go | ImplicitAdmins | func (l *TeamLoader) ImplicitAdmins(ctx context.Context, teamID keybase1.TeamID) (impAdmins []keybase1.UserVersion, err error) {
impAdminsMap := make(map[string]keybase1.UserVersion) // map to remove dups
err = l.MapTeamAncestors(ctx, func(t keybase1.TeamSigChainState) error {
ancestorChain := TeamSigChainState{inn... | go | func (l *TeamLoader) ImplicitAdmins(ctx context.Context, teamID keybase1.TeamID) (impAdmins []keybase1.UserVersion, err error) {
impAdminsMap := make(map[string]keybase1.UserVersion) // map to remove dups
err = l.MapTeamAncestors(ctx, func(t keybase1.TeamSigChainState) error {
ancestorChain := TeamSigChainState{inn... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"ImplicitAdmins",
"(",
"ctx",
"context",
".",
"Context",
",",
"teamID",
"keybase1",
".",
"TeamID",
")",
"(",
"impAdmins",
"[",
"]",
"keybase1",
".",
"UserVersion",
",",
"err",
"error",
")",
"{",
"impAdminsMap",
"... | // List all the admins of ancestor teams.
// Includes admins of the specified team only if they are also admins of ancestor teams.
// The specified team must be a subteam, or an error is returned.
// Always sends a flurry of RPCs to get the most up to date info. | [
"List",
"all",
"the",
"admins",
"of",
"ancestor",
"teams",
".",
"Includes",
"admins",
"of",
"the",
"specified",
"team",
"only",
"if",
"they",
"are",
"also",
"admins",
"of",
"ancestor",
"teams",
".",
"The",
"specified",
"team",
"must",
"be",
"a",
"subteam",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1368-L1392 |
159,814 | keybase/client | go/teams/loader.go | MapTeamAncestors | func (l *TeamLoader) MapTeamAncestors(ctx context.Context, f func(t keybase1.TeamSigChainState) error, teamID keybase1.TeamID, reason string, forceFullReloadOnceToAssert func(t keybase1.TeamSigChainState) bool) (err error) {
me, err := l.world.getMe(ctx)
if err != nil {
return err
}
// Load the argument team
te... | go | func (l *TeamLoader) MapTeamAncestors(ctx context.Context, f func(t keybase1.TeamSigChainState) error, teamID keybase1.TeamID, reason string, forceFullReloadOnceToAssert func(t keybase1.TeamSigChainState) bool) (err error) {
me, err := l.world.getMe(ctx)
if err != nil {
return err
}
// Load the argument team
te... | [
"func",
"(",
"l",
"*",
"TeamLoader",
")",
"MapTeamAncestors",
"(",
"ctx",
"context",
".",
"Context",
",",
"f",
"func",
"(",
"t",
"keybase1",
".",
"TeamSigChainState",
")",
"error",
",",
"teamID",
"keybase1",
".",
"TeamID",
",",
"reason",
"string",
",",
"... | // MapTeamAncestors does NOT map over the team itself. | [
"MapTeamAncestors",
"does",
"NOT",
"map",
"over",
"the",
"team",
"itself",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/loader.go#L1395-L1415 |
159,815 | keybase/client | go/service/ctl.go | Stop | func (c *CtlHandler) Stop(ctx context.Context, args keybase1.StopArg) error {
c.G().Log.Info("Ctl: Stop: StopAllButService")
install.StopAllButService(libkb.NewMetaContext(ctx, c.G()), args.ExitCode)
c.G().Log.Info("Ctl: Stop: Stopping service")
c.service.Stop(args.ExitCode)
return nil
} | go | func (c *CtlHandler) Stop(ctx context.Context, args keybase1.StopArg) error {
c.G().Log.Info("Ctl: Stop: StopAllButService")
install.StopAllButService(libkb.NewMetaContext(ctx, c.G()), args.ExitCode)
c.G().Log.Info("Ctl: Stop: Stopping service")
c.service.Stop(args.ExitCode)
return nil
} | [
"func",
"(",
"c",
"*",
"CtlHandler",
")",
"Stop",
"(",
"ctx",
"context",
".",
"Context",
",",
"args",
"keybase1",
".",
"StopArg",
")",
"error",
"{",
"c",
".",
"G",
"(",
")",
".",
"Log",
".",
"Info",
"(",
"\"",
"\"",
")",
"\n",
"install",
".",
"... | // Stop is called on the rpc keybase.1.ctl.stop, which shuts down the service. | [
"Stop",
"is",
"called",
"on",
"the",
"rpc",
"keybase",
".",
"1",
".",
"ctl",
".",
"stop",
"which",
"shuts",
"down",
"the",
"service",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/ctl.go#L30-L36 |
159,816 | keybase/client | go/kbfs/libkbfs/md_util.go | isReadableOrError | func isReadableOrError(
ctx context.Context, kbpki KBPKI, syncGetter syncedTlfGetterSetter,
md ReadOnlyRootMetadata) error {
if !md.IsInitialized() || md.IsReadable() {
return nil
}
// this should only be the case if we're a new device not yet
// added to the set of reader/writer keys.
session, err := kbpki.Ge... | go | func isReadableOrError(
ctx context.Context, kbpki KBPKI, syncGetter syncedTlfGetterSetter,
md ReadOnlyRootMetadata) error {
if !md.IsInitialized() || md.IsReadable() {
return nil
}
// this should only be the case if we're a new device not yet
// added to the set of reader/writer keys.
session, err := kbpki.Ge... | [
"func",
"isReadableOrError",
"(",
"ctx",
"context",
".",
"Context",
",",
"kbpki",
"KBPKI",
",",
"syncGetter",
"syncedTlfGetterSetter",
",",
"md",
"ReadOnlyRootMetadata",
")",
"error",
"{",
"if",
"!",
"md",
".",
"IsInitialized",
"(",
")",
"||",
"md",
".",
"Is... | // Helper which returns nil if the md block is uninitialized or readable by
// the current user. Otherwise an appropriate read access error is returned. | [
"Helper",
"which",
"returns",
"nil",
"if",
"the",
"md",
"block",
"is",
"uninitialized",
"or",
"readable",
"by",
"the",
"current",
"user",
".",
"Otherwise",
"an",
"appropriate",
"read",
"access",
"error",
"is",
"returned",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_util.go#L70-L86 |
159,817 | keybase/client | go/kbfs/libkbfs/md_util.go | getSingleMD | func getSingleMD(ctx context.Context, config Config, id tlf.ID, bid kbfsmd.BranchID,
rev kbfsmd.Revision, mStatus kbfsmd.MergeStatus, lockBeforeGet *keybase1.LockID) (
ImmutableRootMetadata, error) {
rmds, err := getMDRange(
ctx, config, id, bid, rev, rev, mStatus, lockBeforeGet)
if err != nil {
return Immutabl... | go | func getSingleMD(ctx context.Context, config Config, id tlf.ID, bid kbfsmd.BranchID,
rev kbfsmd.Revision, mStatus kbfsmd.MergeStatus, lockBeforeGet *keybase1.LockID) (
ImmutableRootMetadata, error) {
rmds, err := getMDRange(
ctx, config, id, bid, rev, rev, mStatus, lockBeforeGet)
if err != nil {
return Immutabl... | [
"func",
"getSingleMD",
"(",
"ctx",
"context",
".",
"Context",
",",
"config",
"Config",
",",
"id",
"tlf",
".",
"ID",
",",
"bid",
"kbfsmd",
".",
"BranchID",
",",
"rev",
"kbfsmd",
".",
"Revision",
",",
"mStatus",
"kbfsmd",
".",
"MergeStatus",
",",
"lockBefo... | // getSingleMD returns an MD that is required to exist. | [
"getSingleMD",
"returns",
"an",
"MD",
"that",
"is",
"required",
"to",
"exist",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_util.go#L177-L191 |
159,818 | keybase/client | go/kbfs/libkbfs/md_util.go | MakeCopyWithDecryptedPrivateData | func MakeCopyWithDecryptedPrivateData(
ctx context.Context, config Config,
irmdToDecrypt, irmdWithKeys ImmutableRootMetadata, uid keybase1.UID) (
rmdDecrypted ImmutableRootMetadata, err error) {
pmd, err := decryptMDPrivateData(
ctx, config.Codec(), config.Crypto(),
config.BlockCache(), config.BlockOps(),
con... | go | func MakeCopyWithDecryptedPrivateData(
ctx context.Context, config Config,
irmdToDecrypt, irmdWithKeys ImmutableRootMetadata, uid keybase1.UID) (
rmdDecrypted ImmutableRootMetadata, err error) {
pmd, err := decryptMDPrivateData(
ctx, config.Codec(), config.Crypto(),
config.BlockCache(), config.BlockOps(),
con... | [
"func",
"MakeCopyWithDecryptedPrivateData",
"(",
"ctx",
"context",
".",
"Context",
",",
"config",
"Config",
",",
"irmdToDecrypt",
",",
"irmdWithKeys",
"ImmutableRootMetadata",
",",
"uid",
"keybase1",
".",
"UID",
")",
"(",
"rmdDecrypted",
"ImmutableRootMetadata",
",",
... | // MakeCopyWithDecryptedPrivateData makes a copy of the given IRMD,
// decrypting it with the given IRMD with keys. | [
"MakeCopyWithDecryptedPrivateData",
"makes",
"a",
"copy",
"of",
"the",
"given",
"IRMD",
"decrypting",
"it",
"with",
"the",
"given",
"IRMD",
"with",
"keys",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_util.go#L195-L219 |
159,819 | keybase/client | go/kbfs/libkbfs/md_util.go | GetMDRevisionByTime | func GetMDRevisionByTime(
ctx context.Context, config Config, handle *tlfhandle.Handle,
serverTime time.Time) (kbfsmd.Revision, error) {
id := handle.TlfID()
if id == tlf.NullID {
return kbfsmd.RevisionUninitialized, errors.Errorf(
"No ID set in handle %s", handle.GetCanonicalPath())
}
md, err := config.MDO... | go | func GetMDRevisionByTime(
ctx context.Context, config Config, handle *tlfhandle.Handle,
serverTime time.Time) (kbfsmd.Revision, error) {
id := handle.TlfID()
if id == tlf.NullID {
return kbfsmd.RevisionUninitialized, errors.Errorf(
"No ID set in handle %s", handle.GetCanonicalPath())
}
md, err := config.MDO... | [
"func",
"GetMDRevisionByTime",
"(",
"ctx",
"context",
".",
"Context",
",",
"config",
"Config",
",",
"handle",
"*",
"tlfhandle",
".",
"Handle",
",",
"serverTime",
"time",
".",
"Time",
")",
"(",
"kbfsmd",
".",
"Revision",
",",
"error",
")",
"{",
"id",
":="... | // GetMDRevisionByTime returns the revision number of the earliest
// merged MD of `handle` with a server timestamp greater or equal to
// `serverTime`. | [
"GetMDRevisionByTime",
"returns",
"the",
"revision",
"number",
"of",
"the",
"earliest",
"merged",
"MD",
"of",
"handle",
"with",
"a",
"server",
"timestamp",
"greater",
"or",
"equal",
"to",
"serverTime",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_util.go#L396-L411 |
159,820 | keybase/client | go/kbfs/libkbfs/md_util.go | decryptMDPrivateData | func decryptMDPrivateData(ctx context.Context, codec kbfscodec.Codec,
crypto Crypto, bcache data.BlockCache, bops BlockOps,
keyGetter mdDecryptionKeyGetter, teamChecker kbfsmd.TeamMembershipChecker,
osg idutil.OfflineStatusGetter, mode InitMode, uid keybase1.UID,
serializedPrivateMetadata []byte, rmdToDecrypt, rmdW... | go | func decryptMDPrivateData(ctx context.Context, codec kbfscodec.Codec,
crypto Crypto, bcache data.BlockCache, bops BlockOps,
keyGetter mdDecryptionKeyGetter, teamChecker kbfsmd.TeamMembershipChecker,
osg idutil.OfflineStatusGetter, mode InitMode, uid keybase1.UID,
serializedPrivateMetadata []byte, rmdToDecrypt, rmdW... | [
"func",
"decryptMDPrivateData",
"(",
"ctx",
"context",
".",
"Context",
",",
"codec",
"kbfscodec",
".",
"Codec",
",",
"crypto",
"Crypto",
",",
"bcache",
"data",
".",
"BlockCache",
",",
"bops",
"BlockOps",
",",
"keyGetter",
"mdDecryptionKeyGetter",
",",
"teamCheck... | // decryptMDPrivateData does not use uid if the handle is a public one. | [
"decryptMDPrivateData",
"does",
"not",
"use",
"uid",
"if",
"the",
"handle",
"is",
"a",
"public",
"one",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/md_util.go#L609-L669 |
159,821 | keybase/client | go/client/cmd_simplefs.go | NewCmdSimpleFS | func NewCmdSimpleFS(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "fs",
Usage: "Perform filesystem operations",
ArgumentHelp: "[arguments...]",
Subcommands: append([]cli.Command{
NewCmdSimpleFSList(cl, g),
NewCmdSimpleFSCopy(cl, g),
NewCmdSi... | go | func NewCmdSimpleFS(cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "fs",
Usage: "Perform filesystem operations",
ArgumentHelp: "[arguments...]",
Subcommands: append([]cli.Command{
NewCmdSimpleFSList(cl, g),
NewCmdSimpleFSCopy(cl, g),
NewCmdSi... | [
"func",
"NewCmdSimpleFS",
"(",
"cl",
"*",
"libcmdline",
".",
"CommandLine",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
")",
"cli",
".",
"Command",
"{",
"return",
"cli",
".",
"Command",
"{",
"Name",
":",
"\"",
"\"",
",",
"Usage",
":",
"\"",
"\"",
"... | // NewCmdSimpleFS creates the device command, which is just a holder
// for subcommands. | [
"NewCmdSimpleFS",
"creates",
"the",
"device",
"command",
"which",
"is",
"just",
"a",
"holder",
"for",
"subcommands",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_simplefs.go#L27-L55 |
159,822 | keybase/client | go/client/cmd_simplefs.go | checkPathIsDir | func checkPathIsDir(ctx context.Context, cli keybase1.SimpleFSInterface, path keybase1.Path) (bool, string, error) {
var isDir bool
var pathString string
var err error
pathType, _ := path.PathType()
switch pathType {
case keybase1.PathType_KBFS, keybase1.PathType_KBFS_ARCHIVED:
if pathType == keybase1.PathType... | go | func checkPathIsDir(ctx context.Context, cli keybase1.SimpleFSInterface, path keybase1.Path) (bool, string, error) {
var isDir bool
var pathString string
var err error
pathType, _ := path.PathType()
switch pathType {
case keybase1.PathType_KBFS, keybase1.PathType_KBFS_ARCHIVED:
if pathType == keybase1.PathType... | [
"func",
"checkPathIsDir",
"(",
"ctx",
"context",
".",
"Context",
",",
"cli",
"keybase1",
".",
"SimpleFSInterface",
",",
"path",
"keybase1",
".",
"Path",
")",
"(",
"bool",
",",
"string",
",",
"error",
")",
"{",
"var",
"isDir",
"bool",
"\n",
"var",
"pathSt... | // Check whether the given path is a directory and return its string | [
"Check",
"whether",
"the",
"given",
"path",
"is",
"a",
"directory",
"and",
"return",
"its",
"string"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_simplefs.go#L160-L194 |
159,823 | keybase/client | go/client/cmd_simplefs.go | makeDestPath | func makeDestPath(
ctx context.Context,
g *libkb.GlobalContext,
cli keybase1.SimpleFSInterface,
src keybase1.Path,
dest keybase1.Path,
isDestPath bool,
destPathString string) (keybase1.Path, error) {
isSrcDir, srcPathString, err := checkPathIsDir(ctx, cli, src)
// TODO: this error should really be checked, bu... | go | func makeDestPath(
ctx context.Context,
g *libkb.GlobalContext,
cli keybase1.SimpleFSInterface,
src keybase1.Path,
dest keybase1.Path,
isDestPath bool,
destPathString string) (keybase1.Path, error) {
isSrcDir, srcPathString, err := checkPathIsDir(ctx, cli, src)
// TODO: this error should really be checked, bu... | [
"func",
"makeDestPath",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"cli",
"keybase1",
".",
"SimpleFSInterface",
",",
"src",
"keybase1",
".",
"Path",
",",
"dest",
"keybase1",
".",
"Path",
",",
"isDestPath",
"bo... | // Make sure the destination ends with the same filename as the source,
// if any, unless the destination is not a directory | [
"Make",
"sure",
"the",
"destination",
"ends",
"with",
"the",
"same",
"filename",
"as",
"the",
"source",
"if",
"any",
"unless",
"the",
"destination",
"is",
"not",
"a",
"directory"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_simplefs.go#L226-L264 |
159,824 | keybase/client | go/client/cmd_simplefs.go | parseSrcDestArgs | func parseSrcDestArgs(g *libkb.GlobalContext, ctx *cli.Context, name string) ([]keybase1.Path, keybase1.Path, error) {
nargs := len(ctx.Args())
var srcType, destType keybase1.PathType
var srcPaths []keybase1.Path
var destPath keybase1.Path
if nargs < 2 {
return srcPaths, destPath, errors.New(name + " requires ... | go | func parseSrcDestArgs(g *libkb.GlobalContext, ctx *cli.Context, name string) ([]keybase1.Path, keybase1.Path, error) {
nargs := len(ctx.Args())
var srcType, destType keybase1.PathType
var srcPaths []keybase1.Path
var destPath keybase1.Path
if nargs < 2 {
return srcPaths, destPath, errors.New(name + " requires ... | [
"func",
"parseSrcDestArgs",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"ctx",
"*",
"cli",
".",
"Context",
",",
"name",
"string",
")",
"(",
"[",
"]",
"keybase1",
".",
"Path",
",",
"keybase1",
".",
"Path",
",",
"error",
")",
"{",
"nargs",
":=",... | // Make a list of source paths and one destination path from the given command line args | [
"Make",
"a",
"list",
"of",
"source",
"paths",
"and",
"one",
"destination",
"path",
"from",
"the",
"given",
"command",
"line",
"args"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_simplefs.go#L275-L321 |
159,825 | keybase/client | go/slotctx/slotctx.go | Use | func (s *Slot) Use(ctx context.Context) context.Context {
ctx, cancel := context.WithCancel(ctx)
s.mu.Lock()
s.cancel, cancel = cancel, s.cancel
s.mu.Unlock()
if cancel != nil {
cancel()
}
return ctx
} | go | func (s *Slot) Use(ctx context.Context) context.Context {
ctx, cancel := context.WithCancel(ctx)
s.mu.Lock()
s.cancel, cancel = cancel, s.cancel
s.mu.Unlock()
if cancel != nil {
cancel()
}
return ctx
} | [
"func",
"(",
"s",
"*",
"Slot",
")",
"Use",
"(",
"ctx",
"context",
".",
"Context",
")",
"context",
".",
"Context",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithCancel",
"(",
"ctx",
")",
"\n",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
... | // Use derives a context bound to the slot.
// Cancels any context previously bound to the slot. | [
"Use",
"derives",
"a",
"context",
"bound",
"to",
"the",
"slot",
".",
"Cancels",
"any",
"context",
"previously",
"bound",
"to",
"the",
"slot",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/slotctx/slotctx.go#L20-L29 |
159,826 | keybase/client | go/slotctx/slotctx.go | Use | func (s *PrioritySlot) Use(ctx context.Context, priority int) context.Context {
ctx, cancel := context.WithCancel(ctx)
s.mu.Lock()
defer s.mu.Unlock()
if s.shutdown {
// Not accepting new processes.
cancel()
return ctx
}
if s.cancel == nil {
// First use
s.cancel = cancel
s.priority = priority
retur... | go | func (s *PrioritySlot) Use(ctx context.Context, priority int) context.Context {
ctx, cancel := context.WithCancel(ctx)
s.mu.Lock()
defer s.mu.Unlock()
if s.shutdown {
// Not accepting new processes.
cancel()
return ctx
}
if s.cancel == nil {
// First use
s.cancel = cancel
s.priority = priority
retur... | [
"func",
"(",
"s",
"*",
"PrioritySlot",
")",
"Use",
"(",
"ctx",
"context",
".",
"Context",
",",
"priority",
"int",
")",
"context",
".",
"Context",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithCancel",
"(",
"ctx",
")",
"\n",
"s",
".",
"mu",
... | // Use derives a new context.
// Whichever of the argument and the incumbent are lower priority is canceled.
// In a tie the incumbent is canceled. | [
"Use",
"derives",
"a",
"new",
"context",
".",
"Whichever",
"of",
"the",
"argument",
"and",
"the",
"incumbent",
"are",
"lower",
"priority",
"is",
"canceled",
".",
"In",
"a",
"tie",
"the",
"incumbent",
"is",
"canceled",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/slotctx/slotctx.go#L56-L81 |
159,827 | keybase/client | go/slotctx/slotctx.go | Shutdown | func (s *PrioritySlot) Shutdown() {
s.mu.Lock()
defer s.mu.Unlock()
if s.cancel != nil {
s.cancel()
s.cancel = nil
s.priority = 0
}
s.shutdown = true
} | go | func (s *PrioritySlot) Shutdown() {
s.mu.Lock()
defer s.mu.Unlock()
if s.cancel != nil {
s.cancel()
s.cancel = nil
s.priority = 0
}
s.shutdown = true
} | [
"func",
"(",
"s",
"*",
"PrioritySlot",
")",
"Shutdown",
"(",
")",
"{",
"s",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n",
"if",
"s",
".",
"cancel",
"!=",
"nil",
"{",
"s",
".",
"cancel",
"(",
... | // Shutdown disables the slot forever. | [
"Shutdown",
"disables",
"the",
"slot",
"forever",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/slotctx/slotctx.go#L95-L104 |
159,828 | keybase/client | go/chat/s3/ctx.go | NewFakeS3Context | func NewFakeS3Context(ctx context.Context) context.Context {
return context.WithValue(ctx, fakeS3Key, true)
} | go | func NewFakeS3Context(ctx context.Context) context.Context {
return context.WithValue(ctx, fakeS3Key, true)
} | [
"func",
"NewFakeS3Context",
"(",
"ctx",
"context",
".",
"Context",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"fakeS3Key",
",",
"true",
")",
"\n",
"}"
] | // NewFakeS3Context returns a context with the fakeS3Key flag set. | [
"NewFakeS3Context",
"returns",
"a",
"context",
"with",
"the",
"fakeS3Key",
"flag",
"set",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/s3/ctx.go#L12-L14 |
159,829 | keybase/client | go/protocol/stellar1/extras.go | CheckInvariants | func (r Bundle) CheckInvariants() error {
accountIDs := make(map[AccountID]bool)
var foundPrimary bool
for _, entry := range r.Accounts {
_, found := accountIDs[entry.AccountID]
if found {
return fmt.Errorf("duplicate account ID: %v", entry.AccountID)
}
accountIDs[entry.AccountID] = true
if entry.IsPrim... | go | func (r Bundle) CheckInvariants() error {
accountIDs := make(map[AccountID]bool)
var foundPrimary bool
for _, entry := range r.Accounts {
_, found := accountIDs[entry.AccountID]
if found {
return fmt.Errorf("duplicate account ID: %v", entry.AccountID)
}
accountIDs[entry.AccountID] = true
if entry.IsPrim... | [
"func",
"(",
"r",
"Bundle",
")",
"CheckInvariants",
"(",
")",
"error",
"{",
"accountIDs",
":=",
"make",
"(",
"map",
"[",
"AccountID",
"]",
"bool",
")",
"\n",
"var",
"foundPrimary",
"bool",
"\n",
"for",
"_",
",",
"entry",
":=",
"range",
"r",
".",
"Acc... | // CheckInvariants checks that the Bundle satisfies
// 1. No duplicate account IDs
// 2. Exactly one primary account
// 3. Non-negative revision numbers
// 4. Account Bundle accountIDs are consistent
// 5. every account in AccountBundles is also in Accounts | [
"CheckInvariants",
"checks",
"that",
"the",
"Bundle",
"satisfies",
"1",
".",
"No",
"duplicate",
"account",
"IDs",
"2",
".",
"Exactly",
"one",
"primary",
"account",
"3",
".",
"Non",
"-",
"negative",
"revision",
"numbers",
"4",
".",
"Account",
"Bundle",
"accou... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/stellar1/extras.go#L141-L184 |
159,830 | keybase/client | go/engine/prove_check.go | NewProveCheck | func NewProveCheck(g *libkb.GlobalContext, sigID keybase1.SigID) *ProveCheck {
return &ProveCheck{
Contextified: libkb.NewContextified(g),
sigID: sigID,
}
} | go | func NewProveCheck(g *libkb.GlobalContext, sigID keybase1.SigID) *ProveCheck {
return &ProveCheck{
Contextified: libkb.NewContextified(g),
sigID: sigID,
}
} | [
"func",
"NewProveCheck",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"sigID",
"keybase1",
".",
"SigID",
")",
"*",
"ProveCheck",
"{",
"return",
"&",
"ProveCheck",
"{",
"Contextified",
":",
"libkb",
".",
"NewContextified",
"(",
"g",
")",
",",
"sigID",... | // NewProveCheck creates a ProveCheck engine. | [
"NewProveCheck",
"creates",
"a",
"ProveCheck",
"engine",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/prove_check.go#L27-L32 |
159,831 | keybase/client | go/libkb/resolve.go | putToMemCache | func (r *ResolverImpl) putToMemCache(m MetaContext, key string, res ResolveResult) {
if r.cache == nil {
return
}
// Don't cache errors or deleted users
if res.err != nil || res.deleted {
return
}
if !res.HasPrimaryKey() {
m.Warning("Mistaken UID put to mem cache")
if m.G().Env.GetDebug() {
debug.Print... | go | func (r *ResolverImpl) putToMemCache(m MetaContext, key string, res ResolveResult) {
if r.cache == nil {
return
}
// Don't cache errors or deleted users
if res.err != nil || res.deleted {
return
}
if !res.HasPrimaryKey() {
m.Warning("Mistaken UID put to mem cache")
if m.G().Env.GetDebug() {
debug.Print... | [
"func",
"(",
"r",
"*",
"ResolverImpl",
")",
"putToMemCache",
"(",
"m",
"MetaContext",
",",
"key",
"string",
",",
"res",
"ResolveResult",
")",
"{",
"if",
"r",
".",
"cache",
"==",
"nil",
"{",
"return",
"\n",
"}",
"\n",
"// Don't cache errors or deleted users",... | // Put receives a copy of a ResolveResult, clears out the body
// to avoid caching data that can go stale, and stores the result. | [
"Put",
"receives",
"a",
"copy",
"of",
"a",
"ResolveResult",
"clears",
"out",
"the",
"body",
"to",
"avoid",
"caching",
"data",
"that",
"can",
"go",
"stale",
"and",
"stores",
"the",
"result",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/resolve.go#L687-L705 |
159,832 | keybase/client | go/engine/login_provisioned_device.go | NewLoginProvisionedDevice | func NewLoginProvisionedDevice(g *libkb.GlobalContext, username string) *LoginProvisionedDevice {
return &LoginProvisionedDevice{
username: libkb.NewNormalizedUsername(username),
Contextified: libkb.NewContextified(g),
}
} | go | func NewLoginProvisionedDevice(g *libkb.GlobalContext, username string) *LoginProvisionedDevice {
return &LoginProvisionedDevice{
username: libkb.NewNormalizedUsername(username),
Contextified: libkb.NewContextified(g),
}
} | [
"func",
"NewLoginProvisionedDevice",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"username",
"string",
")",
"*",
"LoginProvisionedDevice",
"{",
"return",
"&",
"LoginProvisionedDevice",
"{",
"username",
":",
"libkb",
".",
"NewNormalizedUsername",
"(",
"usernam... | // newLoginCurrentDevice creates a loginProvisionedDevice engine. | [
"newLoginCurrentDevice",
"creates",
"a",
"loginProvisionedDevice",
"engine",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provisioned_device.go#L24-L29 |
159,833 | keybase/client | go/chat/storage/outbox.go | PullAllConversations | func (o *Outbox) PullAllConversations(ctx context.Context, includeErrors bool, remove bool) ([]chat1.OutboxRecord, error) {
locks.Outbox.Lock()
defer locks.Outbox.Unlock()
// Read outbox for the user
obox, err := o.readStorage(ctx)
if err != nil {
return nil, err
}
var res, errors []chat1.OutboxRecord
for _... | go | func (o *Outbox) PullAllConversations(ctx context.Context, includeErrors bool, remove bool) ([]chat1.OutboxRecord, error) {
locks.Outbox.Lock()
defer locks.Outbox.Unlock()
// Read outbox for the user
obox, err := o.readStorage(ctx)
if err != nil {
return nil, err
}
var res, errors []chat1.OutboxRecord
for _... | [
"func",
"(",
"o",
"*",
"Outbox",
")",
"PullAllConversations",
"(",
"ctx",
"context",
".",
"Context",
",",
"includeErrors",
"bool",
",",
"remove",
"bool",
")",
"(",
"[",
"]",
"chat1",
".",
"OutboxRecord",
",",
"error",
")",
"{",
"locks",
".",
"Outbox",
... | // PullAllConversations grabs all outbox entries for the current outbox, and optionally deletes them
// from storage | [
"PullAllConversations",
"grabs",
"all",
"outbox",
"entries",
"for",
"the",
"current",
"outbox",
"and",
"optionally",
"deletes",
"them",
"from",
"storage"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/outbox.go#L210-L247 |
159,834 | keybase/client | go/chat/storage/outbox.go | MarkAsError | func (o *Outbox) MarkAsError(ctx context.Context, obr chat1.OutboxRecord, errRec chat1.OutboxStateError) (res chat1.OutboxRecord, err error) {
locks.Outbox.Lock()
defer locks.Outbox.Unlock()
// Read outbox for the user
obox, err := o.readStorage(ctx)
if err != nil {
return res, err
}
// Loop through and find... | go | func (o *Outbox) MarkAsError(ctx context.Context, obr chat1.OutboxRecord, errRec chat1.OutboxStateError) (res chat1.OutboxRecord, err error) {
locks.Outbox.Lock()
defer locks.Outbox.Unlock()
// Read outbox for the user
obox, err := o.readStorage(ctx)
if err != nil {
return res, err
}
// Loop through and find... | [
"func",
"(",
"o",
"*",
"Outbox",
")",
"MarkAsError",
"(",
"ctx",
"context",
".",
"Context",
",",
"obr",
"chat1",
".",
"OutboxRecord",
",",
"errRec",
"chat1",
".",
"OutboxStateError",
")",
"(",
"res",
"chat1",
".",
"OutboxRecord",
",",
"err",
"error",
")"... | // MarkAsError will either mark an existing record as an error, or it will add the passed
// record as an error with the specified error state | [
"MarkAsError",
"will",
"either",
"mark",
"an",
"existing",
"record",
"as",
"an",
"error",
"or",
"it",
"will",
"add",
"the",
"passed",
"record",
"as",
"an",
"error",
"with",
"the",
"specified",
"error",
"state"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/outbox.go#L333-L367 |
159,835 | keybase/client | go/engine/pgp_purge.go | NewPGPPurge | func NewPGPPurge(g *libkb.GlobalContext, arg keybase1.PGPPurgeArg) *PGPPurge {
return &PGPPurge{
Contextified: libkb.NewContextified(g),
arg: arg,
}
} | go | func NewPGPPurge(g *libkb.GlobalContext, arg keybase1.PGPPurgeArg) *PGPPurge {
return &PGPPurge{
Contextified: libkb.NewContextified(g),
arg: arg,
}
} | [
"func",
"NewPGPPurge",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"arg",
"keybase1",
".",
"PGPPurgeArg",
")",
"*",
"PGPPurge",
"{",
"return",
"&",
"PGPPurge",
"{",
"Contextified",
":",
"libkb",
".",
"NewContextified",
"(",
"g",
")",
",",
"arg",
"... | // NewPGPPurge creates a PGPPurge engine. | [
"NewPGPPurge",
"creates",
"a",
"PGPPurge",
"engine",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_purge.go#L25-L30 |
159,836 | keybase/client | go/kbfs/libfs/metrics_file.go | GetEncodedMetrics | func GetEncodedMetrics(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error) {
return func(context.Context) ([]byte, time.Time, error) {
if registry := config.MetricsRegistry(); registry != nil {
b := bytes.NewBuffer(nil)
metricsutil.WriteMetrics(registry, b)
return b.Bytes(), time.Time{},... | go | func GetEncodedMetrics(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error) {
return func(context.Context) ([]byte, time.Time, error) {
if registry := config.MetricsRegistry(); registry != nil {
b := bytes.NewBuffer(nil)
metricsutil.WriteMetrics(registry, b)
return b.Bytes(), time.Time{},... | [
"func",
"GetEncodedMetrics",
"(",
"config",
"libkbfs",
".",
"Config",
")",
"func",
"(",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"byte",
",",
"time",
".",
"Time",
",",
"error",
")",
"{",
"return",
"func",
"(",
"context",
".",
"Context",
")",
"(... | // GetEncodedMetrics returns metrics encoded as bytes for metrics file. | [
"GetEncodedMetrics",
"returns",
"metrics",
"encoded",
"as",
"bytes",
"for",
"metrics",
"file",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfs/metrics_file.go#L17-L26 |
159,837 | keybase/client | go/chat/flip/flip.go | NewDealer | func NewDealer(dh DealersHelper) *Dealer {
return &Dealer{
dh: dh,
games: make(map[GameKey](chan<- *GameMessageWrapped)),
gameIDs: make(map[GameIDKey]GameMetadata),
chatInputCh: make(chan *GameMessageWrapped),
gameUpdateCh: make(chan GameStateUpdateMessage, 500),
previousGames: ... | go | func NewDealer(dh DealersHelper) *Dealer {
return &Dealer{
dh: dh,
games: make(map[GameKey](chan<- *GameMessageWrapped)),
gameIDs: make(map[GameIDKey]GameMetadata),
chatInputCh: make(chan *GameMessageWrapped),
gameUpdateCh: make(chan GameStateUpdateMessage, 500),
previousGames: ... | [
"func",
"NewDealer",
"(",
"dh",
"DealersHelper",
")",
"*",
"Dealer",
"{",
"return",
"&",
"Dealer",
"{",
"dh",
":",
"dh",
",",
"games",
":",
"make",
"(",
"map",
"[",
"GameKey",
"]",
"(",
"chan",
"<-",
"*",
"GameMessageWrapped",
")",
")",
",",
"gameIDs... | // NewDealer makes a new Dealer with a given DealersHelper | [
"NewDealer",
"makes",
"a",
"new",
"Dealer",
"with",
"a",
"given",
"DealersHelper"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L79-L88 |
159,838 | keybase/client | go/chat/flip/flip.go | Run | func (d *Dealer) Run(ctx context.Context) error {
d.shutdownMu.Lock()
shutdownCh := make(chan struct{})
d.shutdownCh = shutdownCh
d.shutdownMu.Unlock()
for {
select {
case <-ctx.Done():
return ctx.Err()
// This channel never closes
case msg := <-d.chatInputCh:
err := d.handleMessage(ctx, msg)
i... | go | func (d *Dealer) Run(ctx context.Context) error {
d.shutdownMu.Lock()
shutdownCh := make(chan struct{})
d.shutdownCh = shutdownCh
d.shutdownMu.Unlock()
for {
select {
case <-ctx.Done():
return ctx.Err()
// This channel never closes
case msg := <-d.chatInputCh:
err := d.handleMessage(ctx, msg)
i... | [
"func",
"(",
"d",
"*",
"Dealer",
")",
"Run",
"(",
"ctx",
"context",
".",
"Context",
")",
"error",
"{",
"d",
".",
"shutdownMu",
".",
"Lock",
"(",
")",
"\n",
"shutdownCh",
":=",
"make",
"(",
"chan",
"struct",
"{",
"}",
")",
"\n",
"d",
".",
"shutdow... | // Run a dealer in a given context. It will run as long as it isn't shutdown. | [
"Run",
"a",
"dealer",
"in",
"a",
"given",
"context",
".",
"It",
"will",
"run",
"as",
"long",
"as",
"it",
"isn",
"t",
"shutdown",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L97-L121 |
159,839 | keybase/client | go/chat/flip/flip.go | Stop | func (d *Dealer) Stop() {
d.shutdownMu.Lock()
if d.shutdownCh != nil {
close(d.shutdownCh)
d.shutdownCh = nil
}
d.shutdownMu.Unlock()
d.stopGames()
} | go | func (d *Dealer) Stop() {
d.shutdownMu.Lock()
if d.shutdownCh != nil {
close(d.shutdownCh)
d.shutdownCh = nil
}
d.shutdownMu.Unlock()
d.stopGames()
} | [
"func",
"(",
"d",
"*",
"Dealer",
")",
"Stop",
"(",
")",
"{",
"d",
".",
"shutdownMu",
".",
"Lock",
"(",
")",
"\n",
"if",
"d",
".",
"shutdownCh",
"!=",
"nil",
"{",
"close",
"(",
"d",
".",
"shutdownCh",
")",
"\n",
"d",
".",
"shutdownCh",
"=",
"nil... | // Stop a dealer on process shutdown. | [
"Stop",
"a",
"dealer",
"on",
"process",
"shutdown",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L124-L132 |
159,840 | keybase/client | go/chat/flip/flip.go | StartFlip | func (d *Dealer) StartFlip(ctx context.Context, start Start, conversationID chat1.ConversationID) (err error) {
_, err = d.startFlip(ctx, start, conversationID)
return err
} | go | func (d *Dealer) StartFlip(ctx context.Context, start Start, conversationID chat1.ConversationID) (err error) {
_, err = d.startFlip(ctx, start, conversationID)
return err
} | [
"func",
"(",
"d",
"*",
"Dealer",
")",
"StartFlip",
"(",
"ctx",
"context",
".",
"Context",
",",
"start",
"Start",
",",
"conversationID",
"chat1",
".",
"ConversationID",
")",
"(",
"err",
"error",
")",
"{",
"_",
",",
"err",
"=",
"d",
".",
"startFlip",
"... | // StartFlip starts a new flip. Pass it some start parameters as well as a chat conversationID that it
// will take place in. | [
"StartFlip",
"starts",
"a",
"new",
"flip",
".",
"Pass",
"it",
"some",
"start",
"parameters",
"as",
"well",
"as",
"a",
"chat",
"conversationID",
"that",
"it",
"will",
"take",
"place",
"in",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L136-L139 |
159,841 | keybase/client | go/chat/flip/flip.go | StartFlipWithGameID | func (d *Dealer) StartFlipWithGameID(ctx context.Context, start Start, conversationID chat1.ConversationID,
gameID chat1.FlipGameID) (err error) {
_, err = d.startFlipWithGameID(ctx, start, conversationID, gameID)
return err
} | go | func (d *Dealer) StartFlipWithGameID(ctx context.Context, start Start, conversationID chat1.ConversationID,
gameID chat1.FlipGameID) (err error) {
_, err = d.startFlipWithGameID(ctx, start, conversationID, gameID)
return err
} | [
"func",
"(",
"d",
"*",
"Dealer",
")",
"StartFlipWithGameID",
"(",
"ctx",
"context",
".",
"Context",
",",
"start",
"Start",
",",
"conversationID",
"chat1",
".",
"ConversationID",
",",
"gameID",
"chat1",
".",
"FlipGameID",
")",
"(",
"err",
"error",
")",
"{",... | // StartFlipWithGameID starts a new flip. Pass it some start parameters as well as a chat conversationID
// that it will take place in. Also takes a GameID | [
"StartFlipWithGameID",
"starts",
"a",
"new",
"flip",
".",
"Pass",
"it",
"some",
"start",
"parameters",
"as",
"well",
"as",
"a",
"chat",
"conversationID",
"that",
"it",
"will",
"take",
"place",
"in",
".",
"Also",
"takes",
"a",
"GameID"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L143-L147 |
159,842 | keybase/client | go/chat/flip/flip.go | InjectIncomingChat | func (d *Dealer) InjectIncomingChat(ctx context.Context, sender UserDevice,
conversationID chat1.ConversationID, gameID chat1.FlipGameID, body GameMessageEncoded,
firstInConversation bool) error {
gmwe := GameMessageWrappedEncoded{
Sender: sender,
GameID: gameID,
Body: ... | go | func (d *Dealer) InjectIncomingChat(ctx context.Context, sender UserDevice,
conversationID chat1.ConversationID, gameID chat1.FlipGameID, body GameMessageEncoded,
firstInConversation bool) error {
gmwe := GameMessageWrappedEncoded{
Sender: sender,
GameID: gameID,
Body: ... | [
"func",
"(",
"d",
"*",
"Dealer",
")",
"InjectIncomingChat",
"(",
"ctx",
"context",
".",
"Context",
",",
"sender",
"UserDevice",
",",
"conversationID",
"chat1",
".",
"ConversationID",
",",
"gameID",
"chat1",
".",
"FlipGameID",
",",
"body",
"GameMessageEncoded",
... | // InjectIncomingChat should be called whenever a new flip game comes in that's relevant for flips.
// Call this with the sender's information, the channel information, and the body data that came in.
// The last bool is true only if this is the first message in the channel. The current model is that only
// one "game"... | [
"InjectIncomingChat",
"should",
"be",
"called",
"whenever",
"a",
"new",
"flip",
"game",
"comes",
"in",
"that",
"s",
"relevant",
"for",
"flips",
".",
"Call",
"this",
"with",
"the",
"sender",
"s",
"information",
"the",
"channel",
"information",
"and",
"the",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L155-L179 |
159,843 | keybase/client | go/chat/flip/flip.go | NewStartWithBool | func NewStartWithBool(now time.Time, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithBool()
return ret
} | go | func NewStartWithBool(now time.Time, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithBool()
return ret
} | [
"func",
"NewStartWithBool",
"(",
"now",
"time",
".",
"Time",
",",
"nPlayers",
"int",
")",
"Start",
"{",
"ret",
":=",
"newStart",
"(",
"now",
",",
"nPlayers",
")",
"\n",
"ret",
".",
"Params",
"=",
"NewFlipParametersWithBool",
"(",
")",
"\n",
"return",
"re... | // NewStartWithBool makes new start parameters that yield a coinflip game. | [
"NewStartWithBool",
"makes",
"new",
"start",
"parameters",
"that",
"yield",
"a",
"coinflip",
"game",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L182-L186 |
159,844 | keybase/client | go/chat/flip/flip.go | NewStartWithInt | func NewStartWithInt(now time.Time, mod int64, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithInt(mod)
return ret
} | go | func NewStartWithInt(now time.Time, mod int64, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithInt(mod)
return ret
} | [
"func",
"NewStartWithInt",
"(",
"now",
"time",
".",
"Time",
",",
"mod",
"int64",
",",
"nPlayers",
"int",
")",
"Start",
"{",
"ret",
":=",
"newStart",
"(",
"now",
",",
"nPlayers",
")",
"\n",
"ret",
".",
"Params",
"=",
"NewFlipParametersWithInt",
"(",
"mod"... | // NewStartWithInt makes new start parameters that yield a coinflip game that picks an int between
// 0 and mod. | [
"NewStartWithInt",
"makes",
"new",
"start",
"parameters",
"that",
"yield",
"a",
"coinflip",
"game",
"that",
"picks",
"an",
"int",
"between",
"0",
"and",
"mod",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L190-L194 |
159,845 | keybase/client | go/chat/flip/flip.go | NewStartWithBigInt | func NewStartWithBigInt(now time.Time, mod *big.Int, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithBig(mod.Bytes())
return ret
} | go | func NewStartWithBigInt(now time.Time, mod *big.Int, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithBig(mod.Bytes())
return ret
} | [
"func",
"NewStartWithBigInt",
"(",
"now",
"time",
".",
"Time",
",",
"mod",
"*",
"big",
".",
"Int",
",",
"nPlayers",
"int",
")",
"Start",
"{",
"ret",
":=",
"newStart",
"(",
"now",
",",
"nPlayers",
")",
"\n",
"ret",
".",
"Params",
"=",
"NewFlipParameters... | // NewStartWithBigInt makes new start parameters that yield a coinflip game that picks big int between
// 0 and mod. | [
"NewStartWithBigInt",
"makes",
"new",
"start",
"parameters",
"that",
"yield",
"a",
"coinflip",
"game",
"that",
"picks",
"big",
"int",
"between",
"0",
"and",
"mod",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L198-L202 |
159,846 | keybase/client | go/chat/flip/flip.go | NewStartWithShuffle | func NewStartWithShuffle(now time.Time, n int64, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithShuffle(n)
return ret
} | go | func NewStartWithShuffle(now time.Time, n int64, nPlayers int) Start {
ret := newStart(now, nPlayers)
ret.Params = NewFlipParametersWithShuffle(n)
return ret
} | [
"func",
"NewStartWithShuffle",
"(",
"now",
"time",
".",
"Time",
",",
"n",
"int64",
",",
"nPlayers",
"int",
")",
"Start",
"{",
"ret",
":=",
"newStart",
"(",
"now",
",",
"nPlayers",
")",
"\n",
"ret",
".",
"Params",
"=",
"NewFlipParametersWithShuffle",
"(",
... | // NewStartWithShuffle makes new start parameters for a coinflip that randomly permutes the numbers
// between 0 and n, exclusive. This can be used to shuffle an array of names. | [
"NewStartWithShuffle",
"makes",
"new",
"start",
"parameters",
"for",
"a",
"coinflip",
"that",
"randomly",
"permutes",
"the",
"numbers",
"between",
"0",
"and",
"n",
"exclusive",
".",
"This",
"can",
"be",
"used",
"to",
"shuffle",
"an",
"array",
"of",
"names",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/flip/flip.go#L206-L210 |
159,847 | keybase/client | go/kbfs/kbfsedits/tlf_history.go | AddNotifications | func (th *TlfHistory) AddNotifications(
writerName string, messages []string) (maxRev kbfsmd.Revision, err error) {
newEdits := make(notificationsByRevision, 0, len(messages))
// Unmarshal and sort the new messages.
for _, msg := range messages {
var revList []NotificationMessage
err := json.Unmarshal([]byte(m... | go | func (th *TlfHistory) AddNotifications(
writerName string, messages []string) (maxRev kbfsmd.Revision, err error) {
newEdits := make(notificationsByRevision, 0, len(messages))
// Unmarshal and sort the new messages.
for _, msg := range messages {
var revList []NotificationMessage
err := json.Unmarshal([]byte(m... | [
"func",
"(",
"th",
"*",
"TlfHistory",
")",
"AddNotifications",
"(",
"writerName",
"string",
",",
"messages",
"[",
"]",
"string",
")",
"(",
"maxRev",
"kbfsmd",
".",
"Revision",
",",
"err",
"error",
")",
"{",
"newEdits",
":=",
"make",
"(",
"notificationsByRe... | // AddNotifications takes in a set of messages in this TLF by
// `writer`, and adds them to the history. Once done adding messages,
// the caller should call `Recompute` to find out if more messages
// should be added for any particular writer. It returns the maximum
// known revision including an update from this wr... | [
"AddNotifications",
"takes",
"in",
"a",
"set",
"of",
"messages",
"in",
"this",
"TLF",
"by",
"writer",
"and",
"adds",
"them",
"to",
"the",
"history",
".",
"Once",
"done",
"adding",
"messages",
"the",
"caller",
"should",
"call",
"Recompute",
"to",
"find",
"o... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsedits/tlf_history.go#L126-L176 |
159,848 | keybase/client | go/kbfs/kbfsedits/tlf_history.go | AddUnflushedNotifications | func (th *TlfHistory) AddUnflushedNotifications(
loggedInUser string, msgs []NotificationMessage) {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed == nil {
th.unflushed = &writerNotifications{loggedInUser, nil, nil}
}
if th.unflushed.writerName != loggedInUser {
panic(fmt.Sprintf("Logged-in user %s doe... | go | func (th *TlfHistory) AddUnflushedNotifications(
loggedInUser string, msgs []NotificationMessage) {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed == nil {
th.unflushed = &writerNotifications{loggedInUser, nil, nil}
}
if th.unflushed.writerName != loggedInUser {
panic(fmt.Sprintf("Logged-in user %s doe... | [
"func",
"(",
"th",
"*",
"TlfHistory",
")",
"AddUnflushedNotifications",
"(",
"loggedInUser",
"string",
",",
"msgs",
"[",
"]",
"NotificationMessage",
")",
"{",
"th",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"th",
".",
"lock",
".",
"Unlock",
"(",... | // AddUnflushedNotifications adds notifications to a special
// "unflushed" list that takes precedences over the regular
// notifications with revision numbers equal or greater to the minimum
// unflushed revision. | [
"AddUnflushedNotifications",
"adds",
"notifications",
"to",
"a",
"special",
"unflushed",
"list",
"that",
"takes",
"precedences",
"over",
"the",
"regular",
"notifications",
"with",
"revision",
"numbers",
"equal",
"or",
"greater",
"to",
"the",
"minimum",
"unflushed",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsedits/tlf_history.go#L182-L200 |
159,849 | keybase/client | go/kbfs/kbfsedits/tlf_history.go | FlushRevision | func (th *TlfHistory) FlushRevision(rev kbfsmd.Revision) {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed == nil {
return
}
lastToKeep := len(th.unflushed.notifications) - 1
for ; lastToKeep >= 0; lastToKeep-- {
if th.unflushed.notifications[lastToKeep].Revision > rev {
break
}
}
if lastToKeep <... | go | func (th *TlfHistory) FlushRevision(rev kbfsmd.Revision) {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed == nil {
return
}
lastToKeep := len(th.unflushed.notifications) - 1
for ; lastToKeep >= 0; lastToKeep-- {
if th.unflushed.notifications[lastToKeep].Revision > rev {
break
}
}
if lastToKeep <... | [
"func",
"(",
"th",
"*",
"TlfHistory",
")",
"FlushRevision",
"(",
"rev",
"kbfsmd",
".",
"Revision",
")",
"{",
"th",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"th",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"th",
".",
"unflushed",
... | // FlushRevision clears all any unflushed notifications with a
// revision equal or less than `rev`. | [
"FlushRevision",
"clears",
"all",
"any",
"unflushed",
"notifications",
"with",
"a",
"revision",
"equal",
"or",
"less",
"than",
"rev",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsedits/tlf_history.go#L204-L222 |
159,850 | keybase/client | go/kbfs/kbfsedits/tlf_history.go | ClearAllUnflushed | func (th *TlfHistory) ClearAllUnflushed() {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed != nil {
// Invalidate the cached results.
th.computed = false
th.cachedLoggedInUser = ""
}
th.unflushed = nil
} | go | func (th *TlfHistory) ClearAllUnflushed() {
th.lock.Lock()
defer th.lock.Unlock()
if th.unflushed != nil {
// Invalidate the cached results.
th.computed = false
th.cachedLoggedInUser = ""
}
th.unflushed = nil
} | [
"func",
"(",
"th",
"*",
"TlfHistory",
")",
"ClearAllUnflushed",
"(",
")",
"{",
"th",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"th",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"th",
".",
"unflushed",
"!=",
"nil",
"{",
"// Invalidate... | // ClearAllUnflushed clears all unflushed notifications. | [
"ClearAllUnflushed",
"clears",
"all",
"unflushed",
"notifications",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsedits/tlf_history.go#L225-L234 |
159,851 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorUnauthorized) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorUnauthorized
s.Name = "SESSION_UNAUTHORIZED"
s.Desc = e.Msg
return
} | go | func (e ServerErrorUnauthorized) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorUnauthorized
s.Name = "SESSION_UNAUTHORIZED"
s.Desc = e.Msg
return
} | [
"func",
"(",
"e",
"ServerErrorUnauthorized",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorUnauthorized",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e"... | // ToStatus implements the ExportableError interface for ServerErrorUnauthorized. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorUnauthorized",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L87-L92 |
159,852 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorOverQuota) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorOverQuota
s.Name = "QUOTA_EXCEEDED"
s.Desc = e.Msg
s.Fields = append(s.Fields, keybase1.StringKVPair{
Key: "QUOTA_USAGE",
Value: strconv.FormatInt(e.Usage, 10),
})
s.Fields = append(s.Fields, keybase1.StringKVPair{
... | go | func (e ServerErrorOverQuota) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorOverQuota
s.Name = "QUOTA_EXCEEDED"
s.Desc = e.Msg
s.Fields = append(s.Fields, keybase1.StringKVPair{
Key: "QUOTA_USAGE",
Value: strconv.FormatInt(e.Usage, 10),
})
s.Fields = append(s.Fields, keybase1.StringKVPair{
... | [
"func",
"(",
"e",
"ServerErrorOverQuota",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorOverQuota",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e",
".... | // ToStatus implements the ExportableError interface for ServerErrorOverQuota. | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorOverQuota",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L114-L131 |
159,853 | keybase/client | go/kbfs/kbfsblock/server_errors.go | Error | func (e ServerErrorOverQuota) Error() string {
return fmt.Sprintf(
"ServerErrorOverQuota{Msg: %q, Usage: %d, Limit: %d, Throttled: %t}",
e.Msg, e.Usage, e.Limit, e.Throttled)
} | go | func (e ServerErrorOverQuota) Error() string {
return fmt.Sprintf(
"ServerErrorOverQuota{Msg: %q, Usage: %d, Limit: %d, Throttled: %t}",
e.Msg, e.Usage, e.Limit, e.Throttled)
} | [
"func",
"(",
"e",
"ServerErrorOverQuota",
")",
"Error",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"e",
".",
"Msg",
",",
"e",
".",
"Usage",
",",
"e",
".",
"Limit",
",",
"e",
".",
"Throttled",
")",
"\n",
"}"
] | // Error implements the Error interface for ServerErrorOverQuota. | [
"Error",
"implements",
"the",
"Error",
"interface",
"for",
"ServerErrorOverQuota",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L134-L138 |
159,854 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorBlockNonExistent) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBlockNonExistent
s.Name = "BLOCK_NONEXISTENT"
s.Desc = e.Msg
return
} | go | func (e ServerErrorBlockNonExistent) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBlockNonExistent
s.Name = "BLOCK_NONEXISTENT"
s.Desc = e.Msg
return
} | [
"func",
"(",
"e",
"ServerErrorBlockNonExistent",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorBlockNonExistent",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=... | // ToStatus implements the ExportableError interface for ServerErrorBlockNonExistent | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorBlockNonExistent"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L146-L151 |
159,855 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorBlockDeleted) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBlockDeleted
s.Name = "BLOCK_DELETED"
s.Desc = e.Msg
return
} | go | func (e ServerErrorBlockDeleted) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorBlockDeleted
s.Name = "BLOCK_DELETED"
s.Desc = e.Msg
return
} | [
"func",
"(",
"e",
"ServerErrorBlockDeleted",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorBlockDeleted",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
"e"... | // ToStatus implements the ExportableError interface for ServerErrorBlockDeleted | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorBlockDeleted"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L188-L193 |
159,856 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorNonceNonExistent) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorNonceNonExistent
s.Name = "BLOCK_NONCENONEXISTENT"
s.Desc = e.Msg
return
} | go | func (e ServerErrorNonceNonExistent) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorNonceNonExistent
s.Name = "BLOCK_NONCENONEXISTENT"
s.Desc = e.Msg
return
} | [
"func",
"(",
"e",
"ServerErrorNonceNonExistent",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorNonceNonExistent",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=... | // ToStatus implements the ExportableError interface for ServerErrorNonceNonExistent | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorNonceNonExistent"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L230-L235 |
159,857 | keybase/client | go/kbfs/kbfsblock/server_errors.go | ToStatus | func (e ServerErrorMaxRefExceeded) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorMaxRefExceeded
s.Name = "BLOCK_MAXREFEXCEEDED"
s.Desc = e.Msg
return
} | go | func (e ServerErrorMaxRefExceeded) ToStatus() (s keybase1.Status) {
s.Code = StatusCodeServerErrorMaxRefExceeded
s.Name = "BLOCK_MAXREFEXCEEDED"
s.Desc = e.Msg
return
} | [
"func",
"(",
"e",
"ServerErrorMaxRefExceeded",
")",
"ToStatus",
"(",
")",
"(",
"s",
"keybase1",
".",
"Status",
")",
"{",
"s",
".",
"Code",
"=",
"StatusCodeServerErrorMaxRefExceeded",
"\n",
"s",
".",
"Name",
"=",
"\"",
"\"",
"\n",
"s",
".",
"Desc",
"=",
... | // ToStatus implements the ExportableError interface for ServerErrorMaxRefExceeded | [
"ToStatus",
"implements",
"the",
"ExportableError",
"interface",
"for",
"ServerErrorMaxRefExceeded"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L251-L256 |
159,858 | keybase/client | go/kbfs/kbfsblock/server_errors.go | IsThrottleError | func IsThrottleError(err error) bool {
if _, ok := err.(ServerErrorThrottle); ok {
return true
}
if quotaErr, ok := err.(ServerErrorOverQuota); ok && quotaErr.Throttled {
return true
}
return false
} | go | func IsThrottleError(err error) bool {
if _, ok := err.(ServerErrorThrottle); ok {
return true
}
if quotaErr, ok := err.(ServerErrorOverQuota); ok && quotaErr.Throttled {
return true
}
return false
} | [
"func",
"IsThrottleError",
"(",
"err",
"error",
")",
"bool",
"{",
"if",
"_",
",",
"ok",
":=",
"err",
".",
"(",
"ServerErrorThrottle",
")",
";",
"ok",
"{",
"return",
"true",
"\n",
"}",
"\n",
"if",
"quotaErr",
",",
"ok",
":=",
"err",
".",
"(",
"Serve... | // IsThrottleError returns whether or not the given error signals
// throttling. | [
"IsThrottleError",
"returns",
"whether",
"or",
"not",
"the",
"given",
"error",
"signals",
"throttling",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfsblock/server_errors.go#L367-L375 |
159,859 | keybase/client | go/engine/selfprovision.go | NewSelfProvisionEngine | func NewSelfProvisionEngine(g *libkb.GlobalContext, deviceName string) *SelfProvisionEngine {
return &SelfProvisionEngine{
Contextified: libkb.NewContextified(g),
DeviceName: deviceName,
}
} | go | func NewSelfProvisionEngine(g *libkb.GlobalContext, deviceName string) *SelfProvisionEngine {
return &SelfProvisionEngine{
Contextified: libkb.NewContextified(g),
DeviceName: deviceName,
}
} | [
"func",
"NewSelfProvisionEngine",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"deviceName",
"string",
")",
"*",
"SelfProvisionEngine",
"{",
"return",
"&",
"SelfProvisionEngine",
"{",
"Contextified",
":",
"libkb",
".",
"NewContextified",
"(",
"g",
")",
","... | // If a device is cloned, we can provision a new device from the current device
// to get out of the cloned state. | [
"If",
"a",
"device",
"is",
"cloned",
"we",
"can",
"provision",
"a",
"new",
"device",
"from",
"the",
"current",
"device",
"to",
"get",
"out",
"of",
"the",
"cloned",
"state",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/selfprovision.go#L24-L29 |
159,860 | keybase/client | go/engine/selfprovision.go | makeDeviceKeysWithSigner | func (e *SelfProvisionEngine) makeDeviceKeysWithSigner(m libkb.MetaContext, signer libkb.GenericKey) error {
if err := e.ensureLKSec(m); err != nil {
return err
}
_, _, deviceType, err := m.G().GetUPAKLoader().LookupUsernameAndDevice(m.Ctx(), e.User.GetUID(), e.G().ActiveDevice.DeviceID())
if err != nil {
retu... | go | func (e *SelfProvisionEngine) makeDeviceKeysWithSigner(m libkb.MetaContext, signer libkb.GenericKey) error {
if err := e.ensureLKSec(m); err != nil {
return err
}
_, _, deviceType, err := m.G().GetUPAKLoader().LookupUsernameAndDevice(m.Ctx(), e.User.GetUID(), e.G().ActiveDevice.DeviceID())
if err != nil {
retu... | [
"func",
"(",
"e",
"*",
"SelfProvisionEngine",
")",
"makeDeviceKeysWithSigner",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"signer",
"libkb",
".",
"GenericKey",
")",
"error",
"{",
"if",
"err",
":=",
"e",
".",
"ensureLKSec",
"(",
"m",
")",
";",
"err",
"!=... | // makeDeviceKeysWithSigner creates device keys given a signing key. | [
"makeDeviceKeysWithSigner",
"creates",
"device",
"keys",
"given",
"a",
"signing",
"key",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/selfprovision.go#L183-L208 |
159,861 | keybase/client | go/engine/selfprovision.go | ppStream | func (e *SelfProvisionEngine) ppStream(m libkb.MetaContext) (*libkb.PassphraseStream, error) {
if m.LoginContext() == nil {
return nil, errors.New("SelfProvisionEngine: ppStream() -> nil ctx.LoginContext")
}
cached := m.LoginContext().PassphraseStreamCache()
if cached == nil {
return nil, errors.New("SelfProvis... | go | func (e *SelfProvisionEngine) ppStream(m libkb.MetaContext) (*libkb.PassphraseStream, error) {
if m.LoginContext() == nil {
return nil, errors.New("SelfProvisionEngine: ppStream() -> nil ctx.LoginContext")
}
cached := m.LoginContext().PassphraseStreamCache()
if cached == nil {
return nil, errors.New("SelfProvis... | [
"func",
"(",
"e",
"*",
"SelfProvisionEngine",
")",
"ppStream",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"*",
"libkb",
".",
"PassphraseStream",
",",
"error",
")",
"{",
"if",
"m",
".",
"LoginContext",
"(",
")",
"==",
"nil",
"{",
"return",
"nil",
... | // copied from loginProvision
// ppStream gets the passphrase stream from the cache | [
"copied",
"from",
"loginProvision",
"ppStream",
"gets",
"the",
"passphrase",
"stream",
"from",
"the",
"cache"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/selfprovision.go#L228-L237 |
159,862 | keybase/client | go/engine/engine.go | isLoggedInWithUIDAndError | func isLoggedInWithUIDAndError(m libkb.MetaContext) (ret bool, uid keybase1.UID, err error) {
ret, uid, err = libkb.BootstrapActiveDeviceWithMetaContext(m)
return ret, uid, err
} | go | func isLoggedInWithUIDAndError(m libkb.MetaContext) (ret bool, uid keybase1.UID, err error) {
ret, uid, err = libkb.BootstrapActiveDeviceWithMetaContext(m)
return ret, uid, err
} | [
"func",
"isLoggedInWithUIDAndError",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"ret",
"bool",
",",
"uid",
"keybase1",
".",
"UID",
",",
"err",
"error",
")",
"{",
"ret",
",",
"uid",
",",
"err",
"=",
"libkb",
".",
"BootstrapActiveDeviceWithMetaContext",
... | // isLoggedInWithUIDAndError conveys if the user is in a logged-in state or not.
// If this function returns `true`, it's because the user is logged in,
// is on a provisioned device, and has an unlocked device key, If this
// function returns `false`, it's because either no one has ever logged onto
// this device, or ... | [
"isLoggedInWithUIDAndError",
"conveys",
"if",
"the",
"user",
"is",
"in",
"a",
"logged",
"-",
"in",
"state",
"or",
"not",
".",
"If",
"this",
"function",
"returns",
"true",
"it",
"s",
"because",
"the",
"user",
"is",
"logged",
"in",
"is",
"on",
"a",
"provis... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/engine.go#L49-L52 |
159,863 | keybase/client | go/libkb/client.go | genClientConfigForInternalAPI | func genClientConfigForInternalAPI(g *GlobalContext) (*ClientConfig, error) {
e := g.Env
serverURI := e.GetServerURI()
if e.GetTorMode().Enabled() {
serverURI = e.GetTorHiddenAddress()
}
if serverURI == "" {
err := fmt.Errorf("Cannot find a server URL")
return nil, err
}
url, err := url.Parse(serverURI)
... | go | func genClientConfigForInternalAPI(g *GlobalContext) (*ClientConfig, error) {
e := g.Env
serverURI := e.GetServerURI()
if e.GetTorMode().Enabled() {
serverURI = e.GetTorHiddenAddress()
}
if serverURI == "" {
err := fmt.Errorf("Cannot find a server URL")
return nil, err
}
url, err := url.Parse(serverURI)
... | [
"func",
"genClientConfigForInternalAPI",
"(",
"g",
"*",
"GlobalContext",
")",
"(",
"*",
"ClientConfig",
",",
"error",
")",
"{",
"e",
":=",
"g",
".",
"Env",
"\n",
"serverURI",
":=",
"e",
".",
"GetServerURI",
"(",
")",
"\n\n",
"if",
"e",
".",
"GetTorMode",... | // GenClientConfigForInternalAPI pulls the information out of the environment configuration,
// and build a Client config that will be used in all API server
// requests | [
"GenClientConfigForInternalAPI",
"pulls",
"the",
"information",
"out",
"of",
"the",
"environment",
"configuration",
"and",
"build",
"a",
"Client",
"config",
"that",
"will",
"be",
"used",
"in",
"all",
"API",
"server",
"requests"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/client.go#L83-L131 |
159,864 | keybase/client | go/kbfs/libpages/server.go | allowDomain | func (s *Server) allowDomain(ctx context.Context, host string) (err error) {
host = strings.ToLower(strings.TrimSpace(host))
if err = s.config.checkDomainLists(host); err != nil {
return err
}
// DoS protection: look up kbp TXT record before attempting ACME cert
// issuance, and only allow those that have DNS r... | go | func (s *Server) allowDomain(ctx context.Context, host string) (err error) {
host = strings.ToLower(strings.TrimSpace(host))
if err = s.config.checkDomainLists(host); err != nil {
return err
}
// DoS protection: look up kbp TXT record before attempting ACME cert
// issuance, and only allow those that have DNS r... | [
"func",
"(",
"s",
"*",
"Server",
")",
"allowDomain",
"(",
"ctx",
"context",
".",
"Context",
",",
"host",
"string",
")",
"(",
"err",
"error",
")",
"{",
"host",
"=",
"strings",
".",
"ToLower",
"(",
"strings",
".",
"TrimSpace",
"(",
"host",
")",
")",
... | // allowDomain is used to determine whether a given domain should be
// served. It's also used as a HostPolicy in autocert package. | [
"allowDomain",
"is",
"used",
"to",
"determine",
"whether",
"a",
"given",
"domain",
"should",
"be",
"served",
".",
"It",
"s",
"also",
"used",
"as",
"a",
"HostPolicy",
"in",
"autocert",
"package",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/server.go#L435-L453 |
159,865 | keybase/client | go/kbfs/libpages/server.go | ListenAndServe | func ListenAndServe(ctx context.Context,
config *ServerConfig, kbfsConfig libkbfs.Config) (err error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
libmime.Patch(additionalMimeTypes)
server := &Server{
config: config,
kbfsConfig: kbfsConfig,
rootLoader: DNSRootLoader{log: config.Logger},
}
... | go | func ListenAndServe(ctx context.Context,
config *ServerConfig, kbfsConfig libkbfs.Config) (err error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
libmime.Patch(additionalMimeTypes)
server := &Server{
config: config,
kbfsConfig: kbfsConfig,
rootLoader: DNSRootLoader{log: config.Logger},
}
... | [
"func",
"ListenAndServe",
"(",
"ctx",
"context",
".",
"Context",
",",
"config",
"*",
"ServerConfig",
",",
"kbfsConfig",
"libkbfs",
".",
"Config",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
",",
"cancel",
":=",
"context",
".",
"WithCancel",
"(",
"ctx",
")... | // ListenAndServe listens on 443 and 80 ports of all addresses, and serve
// Keybase Pages based on config and kbfsConfig. HTTPs setup is handled with
// ACME. | [
"ListenAndServe",
"listens",
"on",
"443",
"and",
"80",
"ports",
"of",
"all",
"addresses",
"and",
"serve",
"Keybase",
"Pages",
"based",
"on",
"config",
"and",
"kbfsConfig",
".",
"HTTPs",
"setup",
"is",
"handled",
"with",
"ACME",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/server.go#L500-L560 |
159,866 | keybase/client | go/kbfs/libpages/stats.go | ReportServedRequest | func (m multiStatReporter) ReportServedRequest(
r *ServedRequestInfo) {
for _, reporter := range m {
reporter.ReportServedRequest(r)
}
} | go | func (m multiStatReporter) ReportServedRequest(
r *ServedRequestInfo) {
for _, reporter := range m {
reporter.ReportServedRequest(r)
}
} | [
"func",
"(",
"m",
"multiStatReporter",
")",
"ReportServedRequest",
"(",
"r",
"*",
"ServedRequestInfo",
")",
"{",
"for",
"_",
",",
"reporter",
":=",
"range",
"m",
"{",
"reporter",
".",
"ReportServedRequest",
"(",
"r",
")",
"\n",
"}",
"\n",
"}"
] | // ReportServedRequest implements the StatsReporter interface. | [
"ReportServedRequest",
"implements",
"the",
"StatsReporter",
"interface",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/stats.go#L85-L90 |
159,867 | keybase/client | go/kbfs/libpages/stats.go | NewFileBasedActivityStatsStorer | func NewFileBasedActivityStatsStorer(
rootPath string, logger *zap.Logger) (ActivityStatsStorer, error) {
err := os.MkdirAll(filepath.Join(rootPath, dirnameTlfStamps), os.ModeDir|0700)
if err != nil {
return nil, err
}
err = os.MkdirAll(filepath.Join(rootPath, dirnameHostStamps), os.ModeDir|0700)
if err != nil ... | go | func NewFileBasedActivityStatsStorer(
rootPath string, logger *zap.Logger) (ActivityStatsStorer, error) {
err := os.MkdirAll(filepath.Join(rootPath, dirnameTlfStamps), os.ModeDir|0700)
if err != nil {
return nil, err
}
err = os.MkdirAll(filepath.Join(rootPath, dirnameHostStamps), os.ModeDir|0700)
if err != nil ... | [
"func",
"NewFileBasedActivityStatsStorer",
"(",
"rootPath",
"string",
",",
"logger",
"*",
"zap",
".",
"Logger",
")",
"(",
"ActivityStatsStorer",
",",
"error",
")",
"{",
"err",
":=",
"os",
".",
"MkdirAll",
"(",
"filepath",
".",
"Join",
"(",
"rootPath",
",",
... | // NewFileBasedActivityStatsStorer creates an ActivityStatsStorer that stores
// activities on a local filesystem.
//
// NOTE that this is meant to be for development and
// testing only and does not scale well. | [
"NewFileBasedActivityStatsStorer",
"creates",
"an",
"ActivityStatsStorer",
"that",
"stores",
"activities",
"on",
"a",
"local",
"filesystem",
".",
"NOTE",
"that",
"this",
"is",
"meant",
"to",
"be",
"for",
"development",
"and",
"testing",
"only",
"and",
"does",
"not... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/stats.go#L161-L178 |
159,868 | keybase/client | go/kbfs/libpages/stats.go | RecordActives | func (s *fileBasedActivityStatsStorer) RecordActives(tlf tlf.ID, host string) {
s.ch <- activity{tlfID: tlf, host: host}
} | go | func (s *fileBasedActivityStatsStorer) RecordActives(tlf tlf.ID, host string) {
s.ch <- activity{tlfID: tlf, host: host}
} | [
"func",
"(",
"s",
"*",
"fileBasedActivityStatsStorer",
")",
"RecordActives",
"(",
"tlf",
"tlf",
".",
"ID",
",",
"host",
"string",
")",
"{",
"s",
".",
"ch",
"<-",
"activity",
"{",
"tlfID",
":",
"tlf",
",",
"host",
":",
"host",
"}",
"\n",
"}"
] | // RecordActives implement the ActivityStatsStorer interface. | [
"RecordActives",
"implement",
"the",
"ActivityStatsStorer",
"interface",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/stats.go#L181-L183 |
159,869 | keybase/client | go/kbfs/libpages/stats.go | GetActivesGetter | func (s *fileBasedActivityStatsStorer) GetActivesGetter() (
getter ActivesGetter, err error) {
tlfStamps, err := ioutil.ReadDir(filepath.Join(s.root, dirnameTlfStamps))
if err != nil {
return nil, err
}
hostStamps, err := ioutil.ReadDir(filepath.Join(s.root, dirnameHostStamps))
if err != nil {
return nil, err... | go | func (s *fileBasedActivityStatsStorer) GetActivesGetter() (
getter ActivesGetter, err error) {
tlfStamps, err := ioutil.ReadDir(filepath.Join(s.root, dirnameTlfStamps))
if err != nil {
return nil, err
}
hostStamps, err := ioutil.ReadDir(filepath.Join(s.root, dirnameHostStamps))
if err != nil {
return nil, err... | [
"func",
"(",
"s",
"*",
"fileBasedActivityStatsStorer",
")",
"GetActivesGetter",
"(",
")",
"(",
"getter",
"ActivesGetter",
",",
"err",
"error",
")",
"{",
"tlfStamps",
",",
"err",
":=",
"ioutil",
".",
"ReadDir",
"(",
"filepath",
".",
"Join",
"(",
"s",
".",
... | // GetActiveTlfs implement the ActivityStatsStorer interface. | [
"GetActiveTlfs",
"implement",
"the",
"ActivityStatsStorer",
"interface",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/stats.go#L216-L230 |
159,870 | keybase/client | go/kbfs/libfs/time_equal.go | TimeEqual | func TimeEqual(a, b time.Time) bool {
if runtime.GOOS == "darwin" {
a = a.Truncate(1 * time.Second)
b = b.Truncate(1 * time.Second)
}
return a.Equal(b)
} | go | func TimeEqual(a, b time.Time) bool {
if runtime.GOOS == "darwin" {
a = a.Truncate(1 * time.Second)
b = b.Truncate(1 * time.Second)
}
return a.Equal(b)
} | [
"func",
"TimeEqual",
"(",
"a",
",",
"b",
"time",
".",
"Time",
")",
"bool",
"{",
"if",
"runtime",
".",
"GOOS",
"==",
"\"",
"\"",
"{",
"a",
"=",
"a",
".",
"Truncate",
"(",
"1",
"*",
"time",
".",
"Second",
")",
"\n",
"b",
"=",
"b",
".",
"Truncat... | // TimeEqual compares two filesystem-related timestamps.
//
// On platforms that don't use nanosecond-accurate timestamps in their
// filesystem APIs, it truncates the timestamps to make them
// comparable. | [
"TimeEqual",
"compares",
"two",
"filesystem",
"-",
"related",
"timestamps",
".",
"On",
"platforms",
"that",
"don",
"t",
"use",
"nanosecond",
"-",
"accurate",
"timestamps",
"in",
"their",
"filesystem",
"APIs",
"it",
"truncates",
"the",
"timestamps",
"to",
"make",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfs/time_equal.go#L17-L23 |
159,871 | keybase/client | go/teams/proofs.go | AddNeededHappensBeforeProof | func (p *proofSetT) AddNeededHappensBeforeProof(ctx context.Context, a proofTerm, b proofTerm, reason string) {
var action string
defer func() {
if action != "discard-easy" && !ShouldSuppressLogging(ctx) {
p.G().Log.CDebugf(ctx, "proofSet add(%v --> %v) [%v] '%v'", a.shortForm(), b.shortForm(), action, reason)
... | go | func (p *proofSetT) AddNeededHappensBeforeProof(ctx context.Context, a proofTerm, b proofTerm, reason string) {
var action string
defer func() {
if action != "discard-easy" && !ShouldSuppressLogging(ctx) {
p.G().Log.CDebugf(ctx, "proofSet add(%v --> %v) [%v] '%v'", a.shortForm(), b.shortForm(), action, reason)
... | [
"func",
"(",
"p",
"*",
"proofSetT",
")",
"AddNeededHappensBeforeProof",
"(",
"ctx",
"context",
".",
"Context",
",",
"a",
"proofTerm",
",",
"b",
"proofTerm",
",",
"reason",
"string",
")",
"{",
"var",
"action",
"string",
"\n",
"defer",
"func",
"(",
")",
"{... | // AddNeededHappensBeforeProof adds a new needed proof to the proof set. The
// proof is that `a` happened before `b`. If there are other proofs in the proof set
// that prove the same thing, then we can tighten those proofs with a and b if
// it makes sense. For instance, if there is an existing proof that c<d,
// b... | [
"AddNeededHappensBeforeProof",
"adds",
"a",
"new",
"needed",
"proof",
"to",
"the",
"proof",
"set",
".",
"The",
"proof",
"is",
"that",
"a",
"happened",
"before",
"b",
".",
"If",
"there",
"are",
"other",
"proofs",
"in",
"the",
"proof",
"set",
"that",
"prove"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L112-L160 |
159,872 | keybase/client | go/teams/proofs.go | SetTeamLinkMap | func (p *proofSetT) SetTeamLinkMap(ctx context.Context, teamID keybase1.TeamID, linkMap linkMapT) {
p.teamLinkMaps[teamID] = linkMap
} | go | func (p *proofSetT) SetTeamLinkMap(ctx context.Context, teamID keybase1.TeamID, linkMap linkMapT) {
p.teamLinkMaps[teamID] = linkMap
} | [
"func",
"(",
"p",
"*",
"proofSetT",
")",
"SetTeamLinkMap",
"(",
"ctx",
"context",
".",
"Context",
",",
"teamID",
"keybase1",
".",
"TeamID",
",",
"linkMap",
"linkMapT",
")",
"{",
"p",
".",
"teamLinkMaps",
"[",
"teamID",
"]",
"=",
"linkMap",
"\n",
"}"
] | // Set the latest link map for the team | [
"Set",
"the",
"latest",
"link",
"map",
"for",
"the",
"team"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L163-L165 |
159,873 | keybase/client | go/teams/proofs.go | lookupMerkleTreeChain | func (p proof) lookupMerkleTreeChain(ctx context.Context, world LoaderContext) (ret *libkb.MerkleTriple, err error) {
return world.merkleLookupTripleAtHashMeta(ctx, p.a.isPublic(), p.a.leafID, p.b.sigMeta.PrevMerkleRootSigned.HashMeta)
} | go | func (p proof) lookupMerkleTreeChain(ctx context.Context, world LoaderContext) (ret *libkb.MerkleTriple, err error) {
return world.merkleLookupTripleAtHashMeta(ctx, p.a.isPublic(), p.a.leafID, p.b.sigMeta.PrevMerkleRootSigned.HashMeta)
} | [
"func",
"(",
"p",
"proof",
")",
"lookupMerkleTreeChain",
"(",
"ctx",
"context",
".",
"Context",
",",
"world",
"LoaderContext",
")",
"(",
"ret",
"*",
"libkb",
".",
"MerkleTriple",
",",
"err",
"error",
")",
"{",
"return",
"world",
".",
"merkleLookupTripleAtHas... | // lookupMerkleTreeChain loads the path up to the merkle tree and back down that corresponds
// to this proof. It will contact the API server. Returns the sigchain tail on success. | [
"lookupMerkleTreeChain",
"loads",
"the",
"path",
"up",
"to",
"the",
"merkle",
"tree",
"and",
"back",
"down",
"that",
"corresponds",
"to",
"this",
"proof",
".",
"It",
"will",
"contact",
"the",
"API",
"server",
".",
"Returns",
"the",
"sigchain",
"tail",
"on",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L205-L207 |
159,874 | keybase/client | go/teams/proofs.go | check | func (p proof) check(ctx context.Context, g *libkb.GlobalContext, world LoaderContext, proofSet *proofSetT) (err error) {
defer func() {
g.Log.CDebugf(ctx, "TeamLoader proofSet check1(%v) -> %v", p.shortForm(), err)
}()
triple, err := p.lookupMerkleTreeChain(ctx, world)
if err != nil {
return err
}
// later... | go | func (p proof) check(ctx context.Context, g *libkb.GlobalContext, world LoaderContext, proofSet *proofSetT) (err error) {
defer func() {
g.Log.CDebugf(ctx, "TeamLoader proofSet check1(%v) -> %v", p.shortForm(), err)
}()
triple, err := p.lookupMerkleTreeChain(ctx, world)
if err != nil {
return err
}
// later... | [
"func",
"(",
"p",
"proof",
")",
"check",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"world",
"LoaderContext",
",",
"proofSet",
"*",
"proofSetT",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"func",
"(",
... | // check a single proof. Call to the merkle API endpoint, and then ensure that the
// data that comes back fits the proof and previously checked sigchain links. | [
"check",
"a",
"single",
"proof",
".",
"Call",
"to",
"the",
"merkle",
"API",
"endpoint",
"and",
"then",
"ensure",
"that",
"the",
"data",
"that",
"comes",
"back",
"fits",
"the",
"proof",
"and",
"previously",
"checked",
"sigchain",
"links",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L211-L239 |
159,875 | keybase/client | go/teams/proofs.go | findLink | func (p proof) findLink(ctx context.Context, g *libkb.GlobalContext, world LoaderContext, leafID keybase1.UserOrTeamID, seqno keybase1.Seqno, firstLinkMap linkMapT, proofSet *proofSetT) (linkID keybase1.LinkID, err error) {
lm := firstLinkMap
if leafID.IsTeamOrSubteam() {
// Pull in the latest link map, instead of... | go | func (p proof) findLink(ctx context.Context, g *libkb.GlobalContext, world LoaderContext, leafID keybase1.UserOrTeamID, seqno keybase1.Seqno, firstLinkMap linkMapT, proofSet *proofSetT) (linkID keybase1.LinkID, err error) {
lm := firstLinkMap
if leafID.IsTeamOrSubteam() {
// Pull in the latest link map, instead of... | [
"func",
"(",
"p",
"proof",
")",
"findLink",
"(",
"ctx",
"context",
".",
"Context",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"world",
"LoaderContext",
",",
"leafID",
"keybase1",
".",
"UserOrTeamID",
",",
"seqno",
"keybase1",
".",
"Seqno",
",",
"... | // Find the LinkID for the leaf at the seqno. | [
"Find",
"the",
"LinkID",
"for",
"the",
"leaf",
"at",
"the",
"seqno",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L242-L279 |
159,876 | keybase/client | go/teams/proofs.go | check | func (p *proofSetT) check(ctx context.Context, world LoaderContext, parallel bool) (err error) {
defer p.G().CTrace(ctx, "TeamLoader proofSet check", func() error { return err })()
if parallel {
return p.checkParallel(ctx, world)
}
var total int
for _, v := range p.proofs {
total += len(v)
}
var i int
fo... | go | func (p *proofSetT) check(ctx context.Context, world LoaderContext, parallel bool) (err error) {
defer p.G().CTrace(ctx, "TeamLoader proofSet check", func() error { return err })()
if parallel {
return p.checkParallel(ctx, world)
}
var total int
for _, v := range p.proofs {
total += len(v)
}
var i int
fo... | [
"func",
"(",
"p",
"*",
"proofSetT",
")",
"check",
"(",
"ctx",
"context",
".",
"Context",
",",
"world",
"LoaderContext",
",",
"parallel",
"bool",
")",
"(",
"err",
"error",
")",
"{",
"defer",
"p",
".",
"G",
"(",
")",
".",
"CTrace",
"(",
"ctx",
",",
... | // check the entire proof set, failing if any one proof fails. | [
"check",
"the",
"entire",
"proof",
"set",
"failing",
"if",
"any",
"one",
"proof",
"fails",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/proofs.go#L286-L310 |
159,877 | keybase/client | go/kbfs/kbfscrypto/auth_token.go | NewAuthToken | func NewAuthToken(signer Signer, tokenType string, expireIn int,
submoduleName, version string, rh AuthTokenRefreshHandler) *AuthToken {
clientName := fmt.Sprintf("go %s %s %s",
submoduleName, libkb.GetPlatformString(), runtime.GOARCH)
authToken := &AuthToken{
signer: signer,
tokenType: tokenType,... | go | func NewAuthToken(signer Signer, tokenType string, expireIn int,
submoduleName, version string, rh AuthTokenRefreshHandler) *AuthToken {
clientName := fmt.Sprintf("go %s %s %s",
submoduleName, libkb.GetPlatformString(), runtime.GOARCH)
authToken := &AuthToken{
signer: signer,
tokenType: tokenType,... | [
"func",
"NewAuthToken",
"(",
"signer",
"Signer",
",",
"tokenType",
"string",
",",
"expireIn",
"int",
",",
"submoduleName",
",",
"version",
"string",
",",
"rh",
"AuthTokenRefreshHandler",
")",
"*",
"AuthToken",
"{",
"clientName",
":=",
"fmt",
".",
"Sprintf",
"(... | // NewAuthToken creates a new authentication token. | [
"NewAuthToken",
"creates",
"a",
"new",
"authentication",
"token",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/auth_token.go#L43-L56 |
159,878 | keybase/client | go/kbfs/kbfscrypto/auth_token.go | signWithUserAndKeyInfo | func (a *AuthToken) signWithUserAndKeyInfo(ctx context.Context,
challengeInfo keybase1.ChallengeInfo, uid keybase1.UID,
username kbname.NormalizedUsername, key VerifyingKey) (string, error) {
// create the token
token := auth.NewToken(uid, username, key.KID(), a.tokenType,
challengeInfo.Challenge, challengeInfo.N... | go | func (a *AuthToken) signWithUserAndKeyInfo(ctx context.Context,
challengeInfo keybase1.ChallengeInfo, uid keybase1.UID,
username kbname.NormalizedUsername, key VerifyingKey) (string, error) {
// create the token
token := auth.NewToken(uid, username, key.KID(), a.tokenType,
challengeInfo.Challenge, challengeInfo.N... | [
"func",
"(",
"a",
"*",
"AuthToken",
")",
"signWithUserAndKeyInfo",
"(",
"ctx",
"context",
".",
"Context",
",",
"challengeInfo",
"keybase1",
".",
"ChallengeInfo",
",",
"uid",
"keybase1",
".",
"UID",
",",
"username",
"kbname",
".",
"NormalizedUsername",
",",
"ke... | // Sign is called to create a new signed authentication token. | [
"Sign",
"is",
"called",
"to",
"create",
"a",
"new",
"signed",
"authentication",
"token",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/auth_token.go#L59-L81 |
159,879 | keybase/client | go/kbfs/kbfscrypto/auth_token.go | SignUserless | func (a *AuthToken) SignUserless(
ctx context.Context, key VerifyingKey) (
string, error) {
// Pass in a reserved, meaningless UID.
return a.signWithUserAndKeyInfo(ctx,
keybase1.ChallengeInfo{Now: time.Now().Unix()},
keybase1.PublicUID, "", key)
} | go | func (a *AuthToken) SignUserless(
ctx context.Context, key VerifyingKey) (
string, error) {
// Pass in a reserved, meaningless UID.
return a.signWithUserAndKeyInfo(ctx,
keybase1.ChallengeInfo{Now: time.Now().Unix()},
keybase1.PublicUID, "", key)
} | [
"func",
"(",
"a",
"*",
"AuthToken",
")",
"SignUserless",
"(",
"ctx",
"context",
".",
"Context",
",",
"key",
"VerifyingKey",
")",
"(",
"string",
",",
"error",
")",
"{",
"// Pass in a reserved, meaningless UID.",
"return",
"a",
".",
"signWithUserAndKeyInfo",
"(",
... | // SignUserless signs the token without a username, UID, or challenge.
// This is useful for server-to-server communication where identity is
// established using only the KID. Assume the client and server
// clocks are roughly synchronized. | [
"SignUserless",
"signs",
"the",
"token",
"without",
"a",
"username",
"UID",
"or",
"challenge",
".",
"This",
"is",
"useful",
"for",
"server",
"-",
"to",
"-",
"server",
"communication",
"where",
"identity",
"is",
"established",
"using",
"only",
"the",
"KID",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/auth_token.go#L103-L110 |
159,880 | keybase/client | go/kbfs/kbfscrypto/auth_token.go | stopTicker | func (a *AuthToken) stopTicker() {
a.tickerMu.Lock()
defer a.tickerMu.Unlock()
if a.tickerCancel != nil {
a.tickerCancel()
a.tickerCancel = nil
}
} | go | func (a *AuthToken) stopTicker() {
a.tickerMu.Lock()
defer a.tickerMu.Unlock()
if a.tickerCancel != nil {
a.tickerCancel()
a.tickerCancel = nil
}
} | [
"func",
"(",
"a",
"*",
"AuthToken",
")",
"stopTicker",
"(",
")",
"{",
"a",
".",
"tickerMu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"a",
".",
"tickerMu",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"a",
".",
"tickerCancel",
"!=",
"nil",
"{",
"a",
".",
... | // Helper to stop the refresh ticker. | [
"Helper",
"to",
"stop",
"the",
"refresh",
"ticker",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfscrypto/auth_token.go#L143-L151 |
159,881 | keybase/client | go/logger/rpc_adapter_depthadder.go | CloneWithAddedDepth | func (l LogOutputWithDepthAdder) CloneWithAddedDepth(depth int) rpc.LogOutputWithDepthAdder {
return LogOutputWithDepthAdder{l.Logger.CloneWithAddedDepth(depth)}
} | go | func (l LogOutputWithDepthAdder) CloneWithAddedDepth(depth int) rpc.LogOutputWithDepthAdder {
return LogOutputWithDepthAdder{l.Logger.CloneWithAddedDepth(depth)}
} | [
"func",
"(",
"l",
"LogOutputWithDepthAdder",
")",
"CloneWithAddedDepth",
"(",
"depth",
"int",
")",
"rpc",
".",
"LogOutputWithDepthAdder",
"{",
"return",
"LogOutputWithDepthAdder",
"{",
"l",
".",
"Logger",
".",
"CloneWithAddedDepth",
"(",
"depth",
")",
"}",
"\n",
... | // CloneWithAddedDepth implements the rpc.LogOutput interface. | [
"CloneWithAddedDepth",
"implements",
"the",
"rpc",
".",
"LogOutput",
"interface",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/logger/rpc_adapter_depthadder.go#L12-L14 |
159,882 | keybase/client | go/kbfs/libkbfs/root_metadata.go | DumpPrivateMetadata | func DumpPrivateMetadata(
codec kbfscodec.Codec, serializedPMDLength int, pmd PrivateMetadata) (string, error) {
s := fmt.Sprintf("Size: %d bytes\n", serializedPMDLength)
eq, err := kbfscodec.Equal(codec, pmd, PrivateMetadata{})
if err != nil {
return "", err
}
if eq {
s += "<Undecryptable>\n"
} else {
c... | go | func DumpPrivateMetadata(
codec kbfscodec.Codec, serializedPMDLength int, pmd PrivateMetadata) (string, error) {
s := fmt.Sprintf("Size: %d bytes\n", serializedPMDLength)
eq, err := kbfscodec.Equal(codec, pmd, PrivateMetadata{})
if err != nil {
return "", err
}
if eq {
s += "<Undecryptable>\n"
} else {
c... | [
"func",
"DumpPrivateMetadata",
"(",
"codec",
"kbfscodec",
".",
"Codec",
",",
"serializedPMDLength",
"int",
",",
"pmd",
"PrivateMetadata",
")",
"(",
"string",
",",
"error",
")",
"{",
"s",
":=",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\\n",
"\"",
",",
"serialized... | // DumpPrivateMetadata returns a detailed dump of the given
// PrivateMetadata's contents. | [
"DumpPrivateMetadata",
"returns",
"a",
"detailed",
"dump",
"of",
"the",
"given",
"PrivateMetadata",
"s",
"contents",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L63-L90 |
159,883 | keybase/client | go/kbfs/libkbfs/root_metadata.go | makeRootMetadata | func makeRootMetadata(bareMd kbfsmd.MutableRootMetadata,
extra kbfsmd.ExtraMetadata, handle *tlfhandle.Handle) *RootMetadata {
if bareMd == nil {
panic("nil kbfsmd.MutableRootMetadata")
}
// extra can be nil.
if handle == nil {
panic("nil handle")
}
return &RootMetadata{
bareMd: bareMd,
extra: ext... | go | func makeRootMetadata(bareMd kbfsmd.MutableRootMetadata,
extra kbfsmd.ExtraMetadata, handle *tlfhandle.Handle) *RootMetadata {
if bareMd == nil {
panic("nil kbfsmd.MutableRootMetadata")
}
// extra can be nil.
if handle == nil {
panic("nil handle")
}
return &RootMetadata{
bareMd: bareMd,
extra: ext... | [
"func",
"makeRootMetadata",
"(",
"bareMd",
"kbfsmd",
".",
"MutableRootMetadata",
",",
"extra",
"kbfsmd",
".",
"ExtraMetadata",
",",
"handle",
"*",
"tlfhandle",
".",
"Handle",
")",
"*",
"RootMetadata",
"{",
"if",
"bareMd",
"==",
"nil",
"{",
"panic",
"(",
"\""... | // makeRootMetadata makes a RootMetadata object from the given
// parameters. | [
"makeRootMetadata",
"makes",
"a",
"RootMetadata",
"object",
"from",
"the",
"given",
"parameters",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L133-L147 |
159,884 | keybase/client | go/kbfs/libkbfs/root_metadata.go | IsReadable | func (md *RootMetadata) IsReadable() bool {
return md.TlfID().Type() == tlf.Public || md.data.Dir.IsInitialized()
} | go | func (md *RootMetadata) IsReadable() bool {
return md.TlfID().Type() == tlf.Public || md.data.Dir.IsInitialized()
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"IsReadable",
"(",
")",
"bool",
"{",
"return",
"md",
".",
"TlfID",
"(",
")",
".",
"Type",
"(",
")",
"==",
"tlf",
".",
"Public",
"||",
"md",
".",
"data",
".",
"Dir",
".",
"IsInitialized",
"(",
")",
"\n"... | // IsReadable returns true if the private metadata can be read. | [
"IsReadable",
"returns",
"true",
"if",
"the",
"private",
"metadata",
"can",
"be",
"read",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L191-L193 |
159,885 | keybase/client | go/kbfs/libkbfs/root_metadata.go | GetTlfHandle | func (md *RootMetadata) GetTlfHandle() *tlfhandle.Handle {
if md.tlfHandle == nil {
panic(fmt.Sprintf("RootMetadata %v with no handle", md))
}
return md.tlfHandle
} | go | func (md *RootMetadata) GetTlfHandle() *tlfhandle.Handle {
if md.tlfHandle == nil {
panic(fmt.Sprintf("RootMetadata %v with no handle", md))
}
return md.tlfHandle
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"GetTlfHandle",
"(",
")",
"*",
"tlfhandle",
".",
"Handle",
"{",
"if",
"md",
".",
"tlfHandle",
"==",
"nil",
"{",
"panic",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"md",
")",
")",
"\n",
"}",
"\n... | // GetTlfHandle returns the TlfHandle for this RootMetadata. | [
"GetTlfHandle",
"returns",
"the",
"TlfHandle",
"for",
"this",
"RootMetadata",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L333-L339 |
159,886 | keybase/client | go/kbfs/libkbfs/root_metadata.go | MakeBareTlfHandle | func (md *RootMetadata) MakeBareTlfHandle() (tlf.Handle, error) {
if md.tlfHandle != nil {
panic(errors.New("MakeBareTlfHandle called when md.tlfHandle exists"))
}
return md.bareMd.MakeBareTlfHandle(md.extra)
} | go | func (md *RootMetadata) MakeBareTlfHandle() (tlf.Handle, error) {
if md.tlfHandle != nil {
panic(errors.New("MakeBareTlfHandle called when md.tlfHandle exists"))
}
return md.bareMd.MakeBareTlfHandle(md.extra)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"MakeBareTlfHandle",
"(",
")",
"(",
"tlf",
".",
"Handle",
",",
"error",
")",
"{",
"if",
"md",
".",
"tlfHandle",
"!=",
"nil",
"{",
"panic",
"(",
"errors",
".",
"New",
"(",
"\"",
"\"",
")",
")",
"\n",
"}... | // MakeBareTlfHandle makes a BareTlfHandle for this
// RootMetadata. Should be used only by servers and MDOps. | [
"MakeBareTlfHandle",
"makes",
"a",
"BareTlfHandle",
"for",
"this",
"RootMetadata",
".",
"Should",
"be",
"used",
"only",
"by",
"servers",
"and",
"MDOps",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L348-L354 |
159,887 | keybase/client | go/kbfs/libkbfs/root_metadata.go | IsInitialized | func (md *RootMetadata) IsInitialized() bool {
keyGen := md.LatestKeyGeneration()
if md.TypeForKeying() == tlf.PublicKeying {
return keyGen == kbfsmd.PublicKeyGen
}
// The data is only initialized once we have at least one set of keys
return keyGen >= kbfsmd.FirstValidKeyGen
} | go | func (md *RootMetadata) IsInitialized() bool {
keyGen := md.LatestKeyGeneration()
if md.TypeForKeying() == tlf.PublicKeying {
return keyGen == kbfsmd.PublicKeyGen
}
// The data is only initialized once we have at least one set of keys
return keyGen >= kbfsmd.FirstValidKeyGen
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"IsInitialized",
"(",
")",
"bool",
"{",
"keyGen",
":=",
"md",
".",
"LatestKeyGeneration",
"(",
")",
"\n",
"if",
"md",
".",
"TypeForKeying",
"(",
")",
"==",
"tlf",
".",
"PublicKeying",
"{",
"return",
"keyGen",
... | // IsInitialized returns whether or not this RootMetadata has been initialized | [
"IsInitialized",
"returns",
"whether",
"or",
"not",
"this",
"RootMetadata",
"has",
"been",
"initialized"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L357-L364 |
159,888 | keybase/client | go/kbfs/libkbfs/root_metadata.go | AddRefBlock | func (md *RootMetadata) AddRefBlock(info data.BlockInfo) {
md.AddRefBytes(uint64(info.EncodedSize))
md.AddDiskUsage(uint64(info.EncodedSize))
md.data.Changes.AddRefBlock(info.BlockPointer)
} | go | func (md *RootMetadata) AddRefBlock(info data.BlockInfo) {
md.AddRefBytes(uint64(info.EncodedSize))
md.AddDiskUsage(uint64(info.EncodedSize))
md.data.Changes.AddRefBlock(info.BlockPointer)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"AddRefBlock",
"(",
"info",
"data",
".",
"BlockInfo",
")",
"{",
"md",
".",
"AddRefBytes",
"(",
"uint64",
"(",
"info",
".",
"EncodedSize",
")",
")",
"\n",
"md",
".",
"AddDiskUsage",
"(",
"uint64",
"(",
"info"... | // AddRefBlock adds the newly-referenced block to the add block change list. | [
"AddRefBlock",
"adds",
"the",
"newly",
"-",
"referenced",
"block",
"to",
"the",
"add",
"block",
"change",
"list",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L367-L371 |
159,889 | keybase/client | go/kbfs/libkbfs/root_metadata.go | AddUnrefBlock | func (md *RootMetadata) AddUnrefBlock(info data.BlockInfo) {
if info.EncodedSize > 0 {
md.AddUnrefBytes(uint64(info.EncodedSize))
md.SetDiskUsage(md.DiskUsage() - uint64(info.EncodedSize))
md.data.Changes.AddUnrefBlock(info.BlockPointer)
}
} | go | func (md *RootMetadata) AddUnrefBlock(info data.BlockInfo) {
if info.EncodedSize > 0 {
md.AddUnrefBytes(uint64(info.EncodedSize))
md.SetDiskUsage(md.DiskUsage() - uint64(info.EncodedSize))
md.data.Changes.AddUnrefBlock(info.BlockPointer)
}
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"AddUnrefBlock",
"(",
"info",
"data",
".",
"BlockInfo",
")",
"{",
"if",
"info",
".",
"EncodedSize",
">",
"0",
"{",
"md",
".",
"AddUnrefBytes",
"(",
"uint64",
"(",
"info",
".",
"EncodedSize",
")",
")",
"\n",
... | // AddUnrefBlock adds the newly-unreferenced block to the add block change list. | [
"AddUnrefBlock",
"adds",
"the",
"newly",
"-",
"unreferenced",
"block",
"to",
"the",
"add",
"block",
"change",
"list",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L374-L380 |
159,890 | keybase/client | go/kbfs/libkbfs/root_metadata.go | AddUpdate | func (md *RootMetadata) AddUpdate(oldInfo data.BlockInfo, newInfo data.BlockInfo) {
md.AddUnrefBytes(uint64(oldInfo.EncodedSize))
md.AddRefBytes(uint64(newInfo.EncodedSize))
md.AddDiskUsage(uint64(newInfo.EncodedSize))
md.SetDiskUsage(md.DiskUsage() - uint64(oldInfo.EncodedSize))
md.data.Changes.AddUpdate(oldInfo.... | go | func (md *RootMetadata) AddUpdate(oldInfo data.BlockInfo, newInfo data.BlockInfo) {
md.AddUnrefBytes(uint64(oldInfo.EncodedSize))
md.AddRefBytes(uint64(newInfo.EncodedSize))
md.AddDiskUsage(uint64(newInfo.EncodedSize))
md.SetDiskUsage(md.DiskUsage() - uint64(oldInfo.EncodedSize))
md.data.Changes.AddUpdate(oldInfo.... | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"AddUpdate",
"(",
"oldInfo",
"data",
".",
"BlockInfo",
",",
"newInfo",
"data",
".",
"BlockInfo",
")",
"{",
"md",
".",
"AddUnrefBytes",
"(",
"uint64",
"(",
"oldInfo",
".",
"EncodedSize",
")",
")",
"\n",
"md",
... | // AddUpdate adds the newly-updated block to the add block change list. | [
"AddUpdate",
"adds",
"the",
"newly",
"-",
"updated",
"block",
"to",
"the",
"add",
"block",
"change",
"list",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L383-L389 |
159,891 | keybase/client | go/kbfs/libkbfs/root_metadata.go | AddOp | func (md *RootMetadata) AddOp(o op) {
md.data.Changes.AddOp(o)
} | go | func (md *RootMetadata) AddOp(o op) {
md.data.Changes.AddOp(o)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"AddOp",
"(",
"o",
"op",
")",
"{",
"md",
".",
"data",
".",
"Changes",
".",
"AddOp",
"(",
"o",
")",
"\n",
"}"
] | // AddOp starts a new operation for this MD update. Subsequent
// AddRefBlock, AddUnrefBlock, and AddUpdate calls will be applied to
// this operation. | [
"AddOp",
"starts",
"a",
"new",
"operation",
"for",
"this",
"MD",
"update",
".",
"Subsequent",
"AddRefBlock",
"AddUnrefBlock",
"and",
"AddUpdate",
"calls",
"will",
"be",
"applied",
"to",
"this",
"operation",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L394-L396 |
159,892 | keybase/client | go/kbfs/libkbfs/root_metadata.go | ClearBlockChanges | func (md *RootMetadata) ClearBlockChanges() {
md.SetRefBytes(0)
md.SetUnrefBytes(0)
md.SetMDRefBytes(0)
md.data.Changes.sizeEstimate = 0
md.data.Changes.Info = data.BlockInfo{}
md.data.Changes.Ops = nil
} | go | func (md *RootMetadata) ClearBlockChanges() {
md.SetRefBytes(0)
md.SetUnrefBytes(0)
md.SetMDRefBytes(0)
md.data.Changes.sizeEstimate = 0
md.data.Changes.Info = data.BlockInfo{}
md.data.Changes.Ops = nil
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"ClearBlockChanges",
"(",
")",
"{",
"md",
".",
"SetRefBytes",
"(",
"0",
")",
"\n",
"md",
".",
"SetUnrefBytes",
"(",
"0",
")",
"\n",
"md",
".",
"SetMDRefBytes",
"(",
"0",
")",
"\n",
"md",
".",
"data",
"."... | // ClearBlockChanges resets the block change lists to empty for this
// RootMetadata. | [
"ClearBlockChanges",
"resets",
"the",
"block",
"change",
"lists",
"to",
"empty",
"for",
"this",
"RootMetadata",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L400-L407 |
159,893 | keybase/client | go/kbfs/libkbfs/root_metadata.go | SetLastGCRevision | func (md *RootMetadata) SetLastGCRevision(rev kbfsmd.Revision) {
md.data.LastGCRevision = rev
} | go | func (md *RootMetadata) SetLastGCRevision(rev kbfsmd.Revision) {
md.data.LastGCRevision = rev
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"SetLastGCRevision",
"(",
"rev",
"kbfsmd",
".",
"Revision",
")",
"{",
"md",
".",
"data",
".",
"LastGCRevision",
"=",
"rev",
"\n",
"}"
] | // SetLastGCRevision sets the last revision up to and including which
// garbage collection was performed on this TLF. | [
"SetLastGCRevision",
"sets",
"the",
"last",
"revision",
"up",
"to",
"and",
"including",
"which",
"garbage",
"collection",
"was",
"performed",
"on",
"this",
"TLF",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L411-L413 |
159,894 | keybase/client | go/kbfs/libkbfs/root_metadata.go | GetTLFCryptKeyParams | func (md *RootMetadata) GetTLFCryptKeyParams(
keyGen kbfsmd.KeyGen, user keybase1.UID, key kbfscrypto.CryptPublicKey) (
kbfscrypto.TLFEphemeralPublicKey, kbfscrypto.EncryptedTLFCryptKeyClientHalf,
kbfscrypto.TLFCryptKeyServerHalfID, bool, error) {
return md.bareMd.GetTLFCryptKeyParams(keyGen, user, key, md.extra)
} | go | func (md *RootMetadata) GetTLFCryptKeyParams(
keyGen kbfsmd.KeyGen, user keybase1.UID, key kbfscrypto.CryptPublicKey) (
kbfscrypto.TLFEphemeralPublicKey, kbfscrypto.EncryptedTLFCryptKeyClientHalf,
kbfscrypto.TLFCryptKeyServerHalfID, bool, error) {
return md.bareMd.GetTLFCryptKeyParams(keyGen, user, key, md.extra)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"GetTLFCryptKeyParams",
"(",
"keyGen",
"kbfsmd",
".",
"KeyGen",
",",
"user",
"keybase1",
".",
"UID",
",",
"key",
"kbfscrypto",
".",
"CryptPublicKey",
")",
"(",
"kbfscrypto",
".",
"TLFEphemeralPublicKey",
",",
"kbfsc... | // GetTLFCryptKeyParams wraps the respective method of the underlying BareRootMetadata for convenience. | [
"GetTLFCryptKeyParams",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L559-L564 |
159,895 | keybase/client | go/kbfs/libkbfs/root_metadata.go | KeyGenerationsToUpdate | func (md *RootMetadata) KeyGenerationsToUpdate() (kbfsmd.KeyGen, kbfsmd.KeyGen) {
return md.bareMd.KeyGenerationsToUpdate()
} | go | func (md *RootMetadata) KeyGenerationsToUpdate() (kbfsmd.KeyGen, kbfsmd.KeyGen) {
return md.bareMd.KeyGenerationsToUpdate()
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"KeyGenerationsToUpdate",
"(",
")",
"(",
"kbfsmd",
".",
"KeyGen",
",",
"kbfsmd",
".",
"KeyGen",
")",
"{",
"return",
"md",
".",
"bareMd",
".",
"KeyGenerationsToUpdate",
"(",
")",
"\n",
"}"
] | // KeyGenerationsToUpdate wraps the respective method of the underlying BareRootMetadata for convenience. | [
"KeyGenerationsToUpdate",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L567-L569 |
159,896 | keybase/client | go/kbfs/libkbfs/root_metadata.go | TlfID | func (md *RootMetadata) TlfID() tlf.ID {
if md == nil || md.bareMd == nil {
return tlf.NullID
}
return md.bareMd.TlfID()
} | go | func (md *RootMetadata) TlfID() tlf.ID {
if md == nil || md.bareMd == nil {
return tlf.NullID
}
return md.bareMd.TlfID()
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"TlfID",
"(",
")",
"tlf",
".",
"ID",
"{",
"if",
"md",
"==",
"nil",
"||",
"md",
".",
"bareMd",
"==",
"nil",
"{",
"return",
"tlf",
".",
"NullID",
"\n",
"}",
"\n",
"return",
"md",
".",
"bareMd",
".",
"T... | // TlfID wraps the respective method of the underlying BareRootMetadata for convenience. | [
"TlfID",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L577-L582 |
159,897 | keybase/client | go/kbfs/libkbfs/root_metadata.go | SetBranchID | func (md *RootMetadata) SetBranchID(bid kbfsmd.BranchID) {
md.bareMd.SetBranchID(bid)
} | go | func (md *RootMetadata) SetBranchID(bid kbfsmd.BranchID) {
md.bareMd.SetBranchID(bid)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"SetBranchID",
"(",
"bid",
"kbfsmd",
".",
"BranchID",
")",
"{",
"md",
".",
"bareMd",
".",
"SetBranchID",
"(",
"bid",
")",
"\n",
"}"
] | // SetBranchID wraps the respective method of the underlying BareRootMetadata for convenience. | [
"SetBranchID",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L723-L725 |
159,898 | keybase/client | go/kbfs/libkbfs/root_metadata.go | SetPrevRoot | func (md *RootMetadata) SetPrevRoot(mdID kbfsmd.ID) {
md.bareMd.SetPrevRoot(mdID)
} | go | func (md *RootMetadata) SetPrevRoot(mdID kbfsmd.ID) {
md.bareMd.SetPrevRoot(mdID)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"SetPrevRoot",
"(",
"mdID",
"kbfsmd",
".",
"ID",
")",
"{",
"md",
".",
"bareMd",
".",
"SetPrevRoot",
"(",
"mdID",
")",
"\n",
"}"
] | // SetPrevRoot wraps the respective method of the underlying BareRootMetadata for convenience. | [
"SetPrevRoot",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L728-L730 |
159,899 | keybase/client | go/kbfs/libkbfs/root_metadata.go | GetSerializedWriterMetadata | func (md *RootMetadata) GetSerializedWriterMetadata(
codec kbfscodec.Codec) ([]byte, error) {
return md.bareMd.GetSerializedWriterMetadata(codec)
} | go | func (md *RootMetadata) GetSerializedWriterMetadata(
codec kbfscodec.Codec) ([]byte, error) {
return md.bareMd.GetSerializedWriterMetadata(codec)
} | [
"func",
"(",
"md",
"*",
"RootMetadata",
")",
"GetSerializedWriterMetadata",
"(",
"codec",
"kbfscodec",
".",
"Codec",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"md",
".",
"bareMd",
".",
"GetSerializedWriterMetadata",
"(",
"codec",
")",
"... | // GetSerializedWriterMetadata wraps the respective method of the underlying BareRootMetadata for convenience. | [
"GetSerializedWriterMetadata",
"wraps",
"the",
"respective",
"method",
"of",
"the",
"underlying",
"BareRootMetadata",
"for",
"convenience",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/root_metadata.go#L738-L741 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.