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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
161,300 | keybase/client | go/kbfs/libpages/config/config_v1.go | Encode | func (c *V1) Encode(w io.Writer, prettify bool) error {
encoder := json.NewEncoder(w)
if prettify {
encoder.SetIndent("", strings.Repeat(" ", 2))
}
return encoder.Encode(c)
} | go | func (c *V1) Encode(w io.Writer, prettify bool) error {
encoder := json.NewEncoder(w)
if prettify {
encoder.SetIndent("", strings.Repeat(" ", 2))
}
return encoder.Encode(c)
} | [
"func",
"(",
"c",
"*",
"V1",
")",
"Encode",
"(",
"w",
"io",
".",
"Writer",
",",
"prettify",
"bool",
")",
"error",
"{",
"encoder",
":=",
"json",
".",
"NewEncoder",
"(",
"w",
")",
"\n",
"if",
"prettify",
"{",
"encoder",
".",
"SetIndent",
"(",
"\"",
... | // Encode implements the Config interface. | [
"Encode",
"implements",
"the",
"Config",
"interface",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/config/config_v1.go#L122-L128 |
161,301 | keybase/client | go/kbfs/libpages/config/config_v1.go | HasBcryptPasswords | func (c *V1) HasBcryptPasswords() (bool, error) {
if err := c.EnsureInit(); err != nil {
return false, err
}
for _, pass := range c.users {
if pass.passwordType() == passwordTypeBcrypt {
return true, nil
}
}
return false, nil
} | go | func (c *V1) HasBcryptPasswords() (bool, error) {
if err := c.EnsureInit(); err != nil {
return false, err
}
for _, pass := range c.users {
if pass.passwordType() == passwordTypeBcrypt {
return true, nil
}
}
return false, nil
} | [
"func",
"(",
"c",
"*",
"V1",
")",
"HasBcryptPasswords",
"(",
")",
"(",
"bool",
",",
"error",
")",
"{",
"if",
"err",
":=",
"c",
".",
"EnsureInit",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"false",
",",
"err",
"\n",
"}",
"\n",
"for",
"_"... | // HasBcryptPasswords checks if any password hash in the config is a bcrypt
// hash. This method is temporary for migration and will go away. | [
"HasBcryptPasswords",
"checks",
"if",
"any",
"password",
"hash",
"in",
"the",
"config",
"is",
"a",
"bcrypt",
"hash",
".",
"This",
"method",
"is",
"temporary",
"for",
"migration",
"and",
"will",
"go",
"away",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libpages/config/config_v1.go#L147-L157 |
161,302 | keybase/client | go/teams/box_audit.go | BoxAuditTeam | func (a *BoxAuditor) BoxAuditTeam(mctx libkb.MetaContext, teamID keybase1.TeamID) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed(fmt.Sprintf("BoxAuditTeam(%s)", teamID), func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature fla... | go | func (a *BoxAuditor) BoxAuditTeam(mctx libkb.MetaContext, teamID keybase1.TeamID) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed(fmt.Sprintf("BoxAuditTeam(%s)", teamID), func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature fla... | [
"func",
"(",
"a",
"*",
"BoxAuditor",
")",
"BoxAuditTeam",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"teamID",
"keybase1",
".",
"TeamID",
")",
"(",
"attempt",
"*",
"keybase1",
".",
"BoxAuditAttempt",
",",
"err",
"error",
")",
"{",
"mctx",
"=",
"a",
... | // BoxAuditTeam performs one attempt of a BoxAudit. If one is in progress for
// the teamid, make a new attempt. If exceeded max tries or hit a malicious
// error, return a fatal error. Otherwise, make a new audit and fill it with
// one attempt. If the attempt failed nonfatally, enqueue it in the retry
// queue. If i... | [
"BoxAuditTeam",
"performs",
"one",
"attempt",
"of",
"a",
"BoxAudit",
".",
"If",
"one",
"is",
"in",
"progress",
"for",
"the",
"teamid",
"make",
"a",
"new",
"attempt",
".",
"If",
"exceeded",
"max",
"tries",
"or",
"hit",
"a",
"malicious",
"error",
"return",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_audit.go#L169-L181 |
161,303 | keybase/client | go/teams/box_audit.go | RetryNextBoxAudit | func (a *BoxAuditor) RetryNextBoxAudit(mctx libkb.MetaContext) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed("RetryNextBoxAudit", func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature flagged off; not RetryNextBoxAuditing...")... | go | func (a *BoxAuditor) RetryNextBoxAudit(mctx libkb.MetaContext) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed("RetryNextBoxAudit", func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature flagged off; not RetryNextBoxAuditing...")... | [
"func",
"(",
"a",
"*",
"BoxAuditor",
")",
"RetryNextBoxAudit",
"(",
"mctx",
"libkb",
".",
"MetaContext",
")",
"(",
"attempt",
"*",
"keybase1",
".",
"BoxAuditAttempt",
",",
"err",
"error",
")",
"{",
"mctx",
"=",
"a",
".",
"initMctx",
"(",
"mctx",
")",
"... | // RetryNextBoxAudit selects a teamID from the box audit retry queue and performs another box audit. | [
"RetryNextBoxAudit",
"selects",
"a",
"teamID",
"from",
"the",
"box",
"audit",
"retry",
"queue",
"and",
"performs",
"another",
"box",
"audit",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_audit.go#L302-L320 |
161,304 | keybase/client | go/teams/box_audit.go | BoxAuditRandomTeam | func (a *BoxAuditor) BoxAuditRandomTeam(mctx libkb.MetaContext) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed("BoxAuditRandomTeam", func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature flagged off; not BoxAuditRandomTeaming..... | go | func (a *BoxAuditor) BoxAuditRandomTeam(mctx libkb.MetaContext) (attempt *keybase1.BoxAuditAttempt, err error) {
mctx = a.initMctx(mctx)
defer mctx.TraceTimed("BoxAuditRandomTeam", func() error { return err })()
if !ShouldRunBoxAudit(mctx) {
mctx.Debug("Box auditor feature flagged off; not BoxAuditRandomTeaming..... | [
"func",
"(",
"a",
"*",
"BoxAuditor",
")",
"BoxAuditRandomTeam",
"(",
"mctx",
"libkb",
".",
"MetaContext",
")",
"(",
"attempt",
"*",
"keybase1",
".",
"BoxAuditAttempt",
",",
"err",
"error",
")",
"{",
"mctx",
"=",
"a",
".",
"initMctx",
"(",
"mctx",
")",
... | // BoxAuditRandomTeam selects a random known team from the slow team or FTL
// cache, including implicit teams, and audits it. It may succeed trivially
// because, for example, user is a reader and so does not have permissions to
// do a box audit or the team is an open team. | [
"BoxAuditRandomTeam",
"selects",
"a",
"random",
"known",
"team",
"from",
"the",
"slow",
"team",
"or",
"FTL",
"cache",
"including",
"implicit",
"teams",
"and",
"audits",
"it",
".",
"It",
"may",
"succeed",
"trivially",
"because",
"for",
"example",
"user",
"is",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_audit.go#L326-L345 |
161,305 | keybase/client | go/teams/box_audit.go | calculateChainSummary | func calculateChainSummary(mctx libkb.MetaContext, team *Team) (summary *boxPublicSummary, err error) {
defer mctx.TraceTimed(fmt.Sprintf("calculateChainSummary(%s)", team.ID), func() error { return err })()
merkleSeqno, err := merkleSeqnoAtGenerationInception(mctx, team.chain())
if err != nil {
return nil, err
... | go | func calculateChainSummary(mctx libkb.MetaContext, team *Team) (summary *boxPublicSummary, err error) {
defer mctx.TraceTimed(fmt.Sprintf("calculateChainSummary(%s)", team.ID), func() error { return err })()
merkleSeqno, err := merkleSeqnoAtGenerationInception(mctx, team.chain())
if err != nil {
return nil, err
... | [
"func",
"calculateChainSummary",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"team",
"*",
"Team",
")",
"(",
"summary",
"*",
"boxPublicSummary",
",",
"err",
"error",
")",
"{",
"defer",
"mctx",
".",
"TraceTimed",
"(",
"fmt",
".",
"Sprintf",
"(",
"\"",
"... | // calculateChainSummary calculates the box summary as implied by the team sigchain and previous links,
// using the last known rotation and subsequent additions as markers for PUK freshness. | [
"calculateChainSummary",
"calculates",
"the",
"box",
"summary",
"as",
"implied",
"by",
"the",
"team",
"sigchain",
"and",
"previous",
"links",
"using",
"the",
"last",
"known",
"rotation",
"and",
"subsequent",
"additions",
"as",
"markers",
"for",
"PUK",
"freshness",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_audit.go#L842-L850 |
161,306 | keybase/client | go/teams/box_audit.go | merkleSeqnoAtGenerationInception | func merkleSeqnoAtGenerationInception(mctx libkb.MetaContext, teamchain *TeamSigChainState) (merkleSeqno keybase1.Seqno, err error) {
ptk, err := teamchain.GetLatestPerTeamKey()
if err != nil {
return 0, err
}
sigchainSeqno := ptk.Seqno
root := teamchain.GetMerkleRoots()[sigchainSeqno]
return root.Seqno, nil
} | go | func merkleSeqnoAtGenerationInception(mctx libkb.MetaContext, teamchain *TeamSigChainState) (merkleSeqno keybase1.Seqno, err error) {
ptk, err := teamchain.GetLatestPerTeamKey()
if err != nil {
return 0, err
}
sigchainSeqno := ptk.Seqno
root := teamchain.GetMerkleRoots()[sigchainSeqno]
return root.Seqno, nil
} | [
"func",
"merkleSeqnoAtGenerationInception",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"teamchain",
"*",
"TeamSigChainState",
")",
"(",
"merkleSeqno",
"keybase1",
".",
"Seqno",
",",
"err",
"error",
")",
"{",
"ptk",
",",
"err",
":=",
"teamchain",
".",
"GetL... | // merkleSeqnoAtGenerationInception assumes TeamSigChainState.MerkleRoots is populated | [
"merkleSeqnoAtGenerationInception",
"assumes",
"TeamSigChainState",
".",
"MerkleRoots",
"is",
"populated"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_audit.go#L971-L979 |
161,307 | keybase/client | go/client/help.go | init | func init() {
cli.AppHelpTemplate = AppHelpTemplate
cli.CommandHelpTemplate = CommandHelpTemplate
cli.SubcommandHelpTemplate = SubcommandHelpTemplate
} | go | func init() {
cli.AppHelpTemplate = AppHelpTemplate
cli.CommandHelpTemplate = CommandHelpTemplate
cli.SubcommandHelpTemplate = SubcommandHelpTemplate
} | [
"func",
"init",
"(",
")",
"{",
"cli",
".",
"AppHelpTemplate",
"=",
"AppHelpTemplate",
"\n",
"cli",
".",
"CommandHelpTemplate",
"=",
"CommandHelpTemplate",
"\n",
"cli",
".",
"SubcommandHelpTemplate",
"=",
"SubcommandHelpTemplate",
"\n",
"}"
] | // Custom help templates for cli package | [
"Custom",
"help",
"templates",
"for",
"cli",
"package"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/help.go#L169-L173 |
161,308 | keybase/client | go/teams/chain_parse.go | ParseTeamChainLink | func ParseTeamChainLink(link string) (res SCChainLink, err error) {
err = json.Unmarshal([]byte(link), &res)
return res, err
} | go | func ParseTeamChainLink(link string) (res SCChainLink, err error) {
err = json.Unmarshal([]byte(link), &res)
return res, err
} | [
"func",
"ParseTeamChainLink",
"(",
"link",
"string",
")",
"(",
"res",
"SCChainLink",
",",
"err",
"error",
")",
"{",
"err",
"=",
"json",
".",
"Unmarshal",
"(",
"[",
"]",
"byte",
"(",
"link",
")",
",",
"&",
"res",
")",
"\n",
"return",
"res",
",",
"er... | // Parse a chain link from a string. Just parses, does not validate. | [
"Parse",
"a",
"chain",
"link",
"from",
"a",
"string",
".",
"Just",
"parses",
"does",
"not",
"validate",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/chain_parse.go#L213-L216 |
161,309 | keybase/client | go/engine/common.go | findDeviceKeys | func findDeviceKeys(m libkb.MetaContext, me *libkb.User) (*libkb.DeviceWithKeys, error) {
// need to be logged in to get a device key (unlocked)
lin, _ := isLoggedIn(m)
if !lin {
return nil, libkb.LoginRequiredError{}
}
// Get unlocked device for decryption and signing
// passing in nil SecretUI since we don't... | go | func findDeviceKeys(m libkb.MetaContext, me *libkb.User) (*libkb.DeviceWithKeys, error) {
// need to be logged in to get a device key (unlocked)
lin, _ := isLoggedIn(m)
if !lin {
return nil, libkb.LoginRequiredError{}
}
// Get unlocked device for decryption and signing
// passing in nil SecretUI since we don't... | [
"func",
"findDeviceKeys",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"me",
"*",
"libkb",
".",
"User",
")",
"(",
"*",
"libkb",
".",
"DeviceWithKeys",
",",
"error",
")",
"{",
"// need to be logged in to get a device key (unlocked)",
"lin",
",",
"_",
":=",
"isLo... | // findDeviceKeys looks for device keys and unlocks them. | [
"findDeviceKeys",
"looks",
"for",
"device",
"keys",
"and",
"unlocks",
"them",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/common.go#L13-L44 |
161,310 | keybase/client | go/engine/common.go | matchPaperKey | func matchPaperKey(m libkb.MetaContext, me *libkb.User, paper string) (*libkb.DeviceWithKeys, error) {
cki := me.GetComputedKeyInfos()
if cki == nil {
return nil, fmt.Errorf("no computed key infos")
}
bdevs := cki.PaperDevices()
if len(bdevs) == 0 {
return nil, libkb.NoPaperKeysError{}
}
pc := new(libkb.Pap... | go | func matchPaperKey(m libkb.MetaContext, me *libkb.User, paper string) (*libkb.DeviceWithKeys, error) {
cki := me.GetComputedKeyInfos()
if cki == nil {
return nil, fmt.Errorf("no computed key infos")
}
bdevs := cki.PaperDevices()
if len(bdevs) == 0 {
return nil, libkb.NoPaperKeysError{}
}
pc := new(libkb.Pap... | [
"func",
"matchPaperKey",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"me",
"*",
"libkb",
".",
"User",
",",
"paper",
"string",
")",
"(",
"*",
"libkb",
".",
"DeviceWithKeys",
",",
"error",
")",
"{",
"cki",
":=",
"me",
".",
"GetComputedKeyInfos",
"(",
")"... | // matchPaperKey checks to make sure paper is a valid paper phrase and that it exists
// in the user's keyfamily. | [
"matchPaperKey",
"checks",
"to",
"make",
"sure",
"paper",
"is",
"a",
"valid",
"paper",
"phrase",
"and",
"that",
"it",
"exists",
"in",
"the",
"user",
"s",
"keyfamily",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/common.go#L70-L140 |
161,311 | keybase/client | go/engine/common.go | fetchLKS | func fetchLKS(m libkb.MetaContext, encKey libkb.GenericKey) (libkb.PassphraseGeneration, libkb.LKSecClientHalf, error) {
arg := libkb.APIArg{
Endpoint: "passphrase/recover",
SessionType: libkb.APISessionTypeREQUIRED,
Args: libkb.HTTPArgs{
"kid": encKey.GetKID(),
},
}
res, err := m.G().API.Get(m, arg)
... | go | func fetchLKS(m libkb.MetaContext, encKey libkb.GenericKey) (libkb.PassphraseGeneration, libkb.LKSecClientHalf, error) {
arg := libkb.APIArg{
Endpoint: "passphrase/recover",
SessionType: libkb.APISessionTypeREQUIRED,
Args: libkb.HTTPArgs{
"kid": encKey.GetKID(),
},
}
res, err := m.G().API.Get(m, arg)
... | [
"func",
"fetchLKS",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"encKey",
"libkb",
".",
"GenericKey",
")",
"(",
"libkb",
".",
"PassphraseGeneration",
",",
"libkb",
".",
"LKSecClientHalf",
",",
"error",
")",
"{",
"arg",
":=",
"libkb",
".",
"APIArg",
"{",
... | // fetchLKS gets the encrypted LKS client half from the server.
// It uses encKey to decrypt it. It also returns the passphrase
// generation. | [
"fetchLKS",
"gets",
"the",
"encrypted",
"LKS",
"client",
"half",
"from",
"the",
"server",
".",
"It",
"uses",
"encKey",
"to",
"decrypt",
"it",
".",
"It",
"also",
"returns",
"the",
"passphrase",
"generation",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/common.go#L145-L178 |
161,312 | keybase/client | go/chat/signencrypt/codec.go | NewEncodingReader | func NewEncodingReader(encKey SecretboxKey, signKey SignKey, signaturePrefix kbcrypto.SignaturePrefix, nonce Nonce, innerReader io.Reader) io.Reader {
return &codecReadWrapper{
innerReader: innerReader,
codec: &encoderCodecShim{NewEncoder(encKey, signKey, signaturePrefix, nonce)},
}
} | go | func NewEncodingReader(encKey SecretboxKey, signKey SignKey, signaturePrefix kbcrypto.SignaturePrefix, nonce Nonce, innerReader io.Reader) io.Reader {
return &codecReadWrapper{
innerReader: innerReader,
codec: &encoderCodecShim{NewEncoder(encKey, signKey, signaturePrefix, nonce)},
}
} | [
"func",
"NewEncodingReader",
"(",
"encKey",
"SecretboxKey",
",",
"signKey",
"SignKey",
",",
"signaturePrefix",
"kbcrypto",
".",
"SignaturePrefix",
",",
"nonce",
"Nonce",
",",
"innerReader",
"io",
".",
"Reader",
")",
"io",
".",
"Reader",
"{",
"return",
"&",
"co... | // NewEncodingReader creates a new streaming encoder.
// The signaturePrefix argument must not contain the null container. | [
"NewEncodingReader",
"creates",
"a",
"new",
"streaming",
"encoder",
".",
"The",
"signaturePrefix",
"argument",
"must",
"not",
"contain",
"the",
"null",
"container",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/signencrypt/codec.go#L476-L481 |
161,313 | keybase/client | go/chat/signencrypt/codec.go | SealWhole | func SealWhole(plaintext []byte, encKey SecretboxKey, signKey SignKey, signaturePrefix kbcrypto.SignaturePrefix, nonce Nonce) []byte {
encoder := NewEncoder(encKey, signKey, signaturePrefix, nonce)
output := encoder.Write(plaintext)
output = append(output, encoder.Finish()...)
return output
} | go | func SealWhole(plaintext []byte, encKey SecretboxKey, signKey SignKey, signaturePrefix kbcrypto.SignaturePrefix, nonce Nonce) []byte {
encoder := NewEncoder(encKey, signKey, signaturePrefix, nonce)
output := encoder.Write(plaintext)
output = append(output, encoder.Finish()...)
return output
} | [
"func",
"SealWhole",
"(",
"plaintext",
"[",
"]",
"byte",
",",
"encKey",
"SecretboxKey",
",",
"signKey",
"SignKey",
",",
"signaturePrefix",
"kbcrypto",
".",
"SignaturePrefix",
",",
"nonce",
"Nonce",
")",
"[",
"]",
"byte",
"{",
"encoder",
":=",
"NewEncoder",
"... | // SealWhole seals all at once using the streaming encoding. | [
"SealWhole",
"seals",
"all",
"at",
"once",
"using",
"the",
"streaming",
"encoding",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/signencrypt/codec.go#L548-L553 |
161,314 | keybase/client | go/kbfs/kbfshash/hash.go | DoRawDefaultHash | func DoRawDefaultHash(p []byte) (HashType, RawDefaultHash) {
return DefaultHashType, RawDefaultHash(sha256.Sum256(p))
} | go | func DoRawDefaultHash(p []byte) (HashType, RawDefaultHash) {
return DefaultHashType, RawDefaultHash(sha256.Sum256(p))
} | [
"func",
"DoRawDefaultHash",
"(",
"p",
"[",
"]",
"byte",
")",
"(",
"HashType",
",",
"RawDefaultHash",
")",
"{",
"return",
"DefaultHashType",
",",
"RawDefaultHash",
"(",
"sha256",
".",
"Sum256",
"(",
"p",
")",
")",
"\n",
"}"
] | // DoRawDefaultHash computes the default keybase hash of the given
// data, and returns the type and the raw hash bytes. | [
"DoRawDefaultHash",
"computes",
"the",
"default",
"keybase",
"hash",
"of",
"the",
"given",
"data",
"and",
"returns",
"the",
"type",
"and",
"the",
"raw",
"hash",
"bytes",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L97-L99 |
161,315 | keybase/client | go/kbfs/kbfshash/hash.go | Copy | func (rdh *RawDefaultHash) Copy() *RawDefaultHash {
if rdh == nil {
return nil
}
hashCopy := RawDefaultHash{}
copy(hashCopy[:], rdh[:])
return &hashCopy
} | go | func (rdh *RawDefaultHash) Copy() *RawDefaultHash {
if rdh == nil {
return nil
}
hashCopy := RawDefaultHash{}
copy(hashCopy[:], rdh[:])
return &hashCopy
} | [
"func",
"(",
"rdh",
"*",
"RawDefaultHash",
")",
"Copy",
"(",
")",
"*",
"RawDefaultHash",
"{",
"if",
"rdh",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"hashCopy",
":=",
"RawDefaultHash",
"{",
"}",
"\n",
"copy",
"(",
"hashCopy",
"[",
":",
"]",... | // Copy returns a copied RawDefaultHash | [
"Copy",
"returns",
"a",
"copied",
"RawDefaultHash"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L102-L109 |
161,316 | keybase/client | go/kbfs/kbfshash/hash.go | HashFromRaw | func HashFromRaw(hashType HashType, rawHash []byte) (Hash, error) {
return HashFromBytes(append([]byte{byte(hashType)}, rawHash...))
} | go | func HashFromRaw(hashType HashType, rawHash []byte) (Hash, error) {
return HashFromBytes(append([]byte{byte(hashType)}, rawHash...))
} | [
"func",
"HashFromRaw",
"(",
"hashType",
"HashType",
",",
"rawHash",
"[",
"]",
"byte",
")",
"(",
"Hash",
",",
"error",
")",
"{",
"return",
"HashFromBytes",
"(",
"append",
"(",
"[",
"]",
"byte",
"{",
"byte",
"(",
"hashType",
")",
"}",
",",
"rawHash",
"... | // HashFromRaw creates a hash from a type and raw hash data. If the
// returned error is nil, the returned Hash is valid. | [
"HashFromRaw",
"creates",
"a",
"hash",
"from",
"a",
"type",
"and",
"raw",
"hash",
"data",
".",
"If",
"the",
"returned",
"error",
"is",
"nil",
"the",
"returned",
"Hash",
"is",
"valid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L125-L127 |
161,317 | keybase/client | go/kbfs/kbfshash/hash.go | HashFromBytes | func HashFromBytes(data []byte) (Hash, error) {
h := Hash{string(data)}
if !h.IsValid() {
return Hash{}, errors.WithStack(InvalidHashError{h})
}
return h, nil
} | go | func HashFromBytes(data []byte) (Hash, error) {
h := Hash{string(data)}
if !h.IsValid() {
return Hash{}, errors.WithStack(InvalidHashError{h})
}
return h, nil
} | [
"func",
"HashFromBytes",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"Hash",
",",
"error",
")",
"{",
"h",
":=",
"Hash",
"{",
"string",
"(",
"data",
")",
"}",
"\n",
"if",
"!",
"h",
".",
"IsValid",
"(",
")",
"{",
"return",
"Hash",
"{",
"}",
",",
"... | // HashFromBytes creates a hash from the given byte array. If the
// returned error is nil, the returned Hash is valid. | [
"HashFromBytes",
"creates",
"a",
"hash",
"from",
"the",
"given",
"byte",
"array",
".",
"If",
"the",
"returned",
"error",
"is",
"nil",
"the",
"returned",
"Hash",
"is",
"valid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L131-L137 |
161,318 | keybase/client | go/kbfs/kbfshash/hash.go | HashFromString | func HashFromString(dataStr string) (Hash, error) {
data, err := hex.DecodeString(dataStr)
if err != nil {
return Hash{}, errors.WithStack(err)
}
return HashFromBytes(data)
} | go | func HashFromString(dataStr string) (Hash, error) {
data, err := hex.DecodeString(dataStr)
if err != nil {
return Hash{}, errors.WithStack(err)
}
return HashFromBytes(data)
} | [
"func",
"HashFromString",
"(",
"dataStr",
"string",
")",
"(",
"Hash",
",",
"error",
")",
"{",
"data",
",",
"err",
":=",
"hex",
".",
"DecodeString",
"(",
"dataStr",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"Hash",
"{",
"}",
",",
"errors",
... | // HashFromString creates a hash from the given string. If the
// returned error is nil, the returned Hash is valid. | [
"HashFromString",
"creates",
"a",
"hash",
"from",
"the",
"given",
"string",
".",
"If",
"the",
"returned",
"error",
"is",
"nil",
"the",
"returned",
"Hash",
"is",
"valid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L141-L147 |
161,319 | keybase/client | go/kbfs/kbfshash/hash.go | DefaultHash | func DefaultHash(buf []byte) (Hash, error) {
hashType, rawHash := DoRawDefaultHash(buf)
return HashFromRaw(hashType, rawHash[:])
} | go | func DefaultHash(buf []byte) (Hash, error) {
hashType, rawHash := DoRawDefaultHash(buf)
return HashFromRaw(hashType, rawHash[:])
} | [
"func",
"DefaultHash",
"(",
"buf",
"[",
"]",
"byte",
")",
"(",
"Hash",
",",
"error",
")",
"{",
"hashType",
",",
"rawHash",
":=",
"DoRawDefaultHash",
"(",
"buf",
")",
"\n",
"return",
"HashFromRaw",
"(",
"hashType",
",",
"rawHash",
"[",
":",
"]",
")",
... | // DefaultHash computes the hash of the given data with the default
// hash type. | [
"DefaultHash",
"computes",
"the",
"hash",
"of",
"the",
"given",
"data",
"with",
"the",
"default",
"hash",
"type",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L151-L154 |
161,320 | keybase/client | go/kbfs/kbfshash/hash.go | DoHash | func DoHash(buf []byte, ht HashType) (Hash, error) {
switch ht {
case SHA256Hash, SHA256HashV2:
default:
return Hash{}, errors.WithStack(UnknownHashTypeError{ht})
}
_, rawHash := DoRawDefaultHash(buf)
return HashFromRaw(ht, rawHash[:])
} | go | func DoHash(buf []byte, ht HashType) (Hash, error) {
switch ht {
case SHA256Hash, SHA256HashV2:
default:
return Hash{}, errors.WithStack(UnknownHashTypeError{ht})
}
_, rawHash := DoRawDefaultHash(buf)
return HashFromRaw(ht, rawHash[:])
} | [
"func",
"DoHash",
"(",
"buf",
"[",
"]",
"byte",
",",
"ht",
"HashType",
")",
"(",
"Hash",
",",
"error",
")",
"{",
"switch",
"ht",
"{",
"case",
"SHA256Hash",
",",
"SHA256HashV2",
":",
"default",
":",
"return",
"Hash",
"{",
"}",
",",
"errors",
".",
"W... | // DoHash computes the hash of the given data with the given hash
// type. | [
"DoHash",
"computes",
"the",
"hash",
"of",
"the",
"given",
"data",
"with",
"the",
"given",
"hash",
"type",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L158-L166 |
161,321 | keybase/client | go/kbfs/kbfshash/hash.go | IsValid | func (h Hash) IsValid() bool {
if len(h.h) < MinHashByteLength {
return false
}
if len(h.h) > MaxHashByteLength {
return false
}
if h.hashType() == InvalidHash {
return false
}
return true
} | go | func (h Hash) IsValid() bool {
if len(h.h) < MinHashByteLength {
return false
}
if len(h.h) > MaxHashByteLength {
return false
}
if h.hashType() == InvalidHash {
return false
}
return true
} | [
"func",
"(",
"h",
"Hash",
")",
"IsValid",
"(",
")",
"bool",
"{",
"if",
"len",
"(",
"h",
".",
"h",
")",
"<",
"MinHashByteLength",
"{",
"return",
"false",
"\n",
"}",
"\n",
"if",
"len",
"(",
"h",
".",
"h",
")",
">",
"MaxHashByteLength",
"{",
"return... | // IsValid returns whether the hash is valid. Note that a hash with an
// unknown version is still valid. | [
"IsValid",
"returns",
"whether",
"the",
"hash",
"is",
"valid",
".",
"Note",
"that",
"a",
"hash",
"with",
"an",
"unknown",
"version",
"is",
"still",
"valid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L183-L196 |
161,322 | keybase/client | go/kbfs/kbfshash/hash.go | MarshalBinary | func (h Hash) MarshalBinary() (data []byte, err error) {
if h == (Hash{}) {
return nil, nil
}
if !h.IsValid() {
return nil, errors.WithStack(InvalidHashError{h})
}
return []byte(h.h), nil
} | go | func (h Hash) MarshalBinary() (data []byte, err error) {
if h == (Hash{}) {
return nil, nil
}
if !h.IsValid() {
return nil, errors.WithStack(InvalidHashError{h})
}
return []byte(h.h), nil
} | [
"func",
"(",
"h",
"Hash",
")",
"MarshalBinary",
"(",
")",
"(",
"data",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"if",
"h",
"==",
"(",
"Hash",
"{",
"}",
")",
"{",
"return",
"nil",
",",
"nil",
"\n",
"}",
"\n\n",
"if",
"!",
"h",
".",
"... | // MarshalBinary implements the encoding.BinaryMarshaler interface for
// Hash. Returns an error if the hash is invalid and not the zero
// hash. | [
"MarshalBinary",
"implements",
"the",
"encoding",
".",
"BinaryMarshaler",
"interface",
"for",
"Hash",
".",
"Returns",
"an",
"error",
"if",
"the",
"hash",
"is",
"invalid",
"and",
"not",
"the",
"zero",
"hash",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L210-L220 |
161,323 | keybase/client | go/kbfs/kbfshash/hash.go | UnmarshalBinary | func (h *Hash) UnmarshalBinary(data []byte) error {
if len(data) == 0 {
*h = Hash{}
return nil
}
h.h = string(data)
if !h.IsValid() {
err := InvalidHashError{*h}
*h = Hash{}
return errors.WithStack(err)
}
return nil
} | go | func (h *Hash) UnmarshalBinary(data []byte) error {
if len(data) == 0 {
*h = Hash{}
return nil
}
h.h = string(data)
if !h.IsValid() {
err := InvalidHashError{*h}
*h = Hash{}
return errors.WithStack(err)
}
return nil
} | [
"func",
"(",
"h",
"*",
"Hash",
")",
"UnmarshalBinary",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"len",
"(",
"data",
")",
"==",
"0",
"{",
"*",
"h",
"=",
"Hash",
"{",
"}",
"\n",
"return",
"nil",
"\n",
"}",
"\n\n",
"h",
".",
"h",
... | // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface
// for Hash. Returns an error if the given byte array is non-empty and
// the hash is invalid. | [
"UnmarshalBinary",
"implements",
"the",
"encoding",
".",
"BinaryUnmarshaler",
"interface",
"for",
"Hash",
".",
"Returns",
"an",
"error",
"if",
"the",
"given",
"byte",
"array",
"is",
"non",
"-",
"empty",
"and",
"the",
"hash",
"is",
"invalid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L225-L239 |
161,324 | keybase/client | go/kbfs/kbfshash/hash.go | Verify | func (h Hash) Verify(buf []byte) error {
if !h.IsValid() {
return errors.WithStack(InvalidHashError{h})
}
expectedH, err := DoHash(buf, h.hashType())
if err != nil {
return err
}
if h != expectedH {
return errors.WithStack(HashMismatchError{expectedH, h})
}
return nil
} | go | func (h Hash) Verify(buf []byte) error {
if !h.IsValid() {
return errors.WithStack(InvalidHashError{h})
}
expectedH, err := DoHash(buf, h.hashType())
if err != nil {
return err
}
if h != expectedH {
return errors.WithStack(HashMismatchError{expectedH, h})
}
return nil
} | [
"func",
"(",
"h",
"Hash",
")",
"Verify",
"(",
"buf",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"!",
"h",
".",
"IsValid",
"(",
")",
"{",
"return",
"errors",
".",
"WithStack",
"(",
"InvalidHashError",
"{",
"h",
"}",
")",
"\n",
"}",
"\n\n",
"expect... | // Verify makes sure that the hash matches the given data and returns
// an error otherwise. | [
"Verify",
"makes",
"sure",
"that",
"the",
"hash",
"matches",
"the",
"given",
"data",
"and",
"returns",
"an",
"error",
"otherwise",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L243-L257 |
161,325 | keybase/client | go/kbfs/kbfshash/hash.go | UnmarshalText | func (h *Hash) UnmarshalText(data []byte) error {
newH, err := HashFromString(string(data))
if err != nil {
return err
}
*h = newH
return nil
} | go | func (h *Hash) UnmarshalText(data []byte) error {
newH, err := HashFromString(string(data))
if err != nil {
return err
}
*h = newH
return nil
} | [
"func",
"(",
"h",
"*",
"Hash",
")",
"UnmarshalText",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"newH",
",",
"err",
":=",
"HashFromString",
"(",
"string",
"(",
"data",
")",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"... | // UnmarshalText implements the encoding.TextUnmarshaler interface
// for Hash. | [
"UnmarshalText",
"implements",
"the",
"encoding",
".",
"TextUnmarshaler",
"interface",
"for",
"Hash",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L267-L274 |
161,326 | keybase/client | go/kbfs/kbfshash/hash.go | DefaultHMAC | func DefaultHMAC(key, buf []byte) (HMAC, error) {
mac := hmac.New(DefaultHashNew, key)
mac.Write(buf)
h, err := HashFromRaw(DefaultHashType, mac.Sum(nil))
if err != nil {
return HMAC{}, err
}
return HMAC{h}, nil
} | go | func DefaultHMAC(key, buf []byte) (HMAC, error) {
mac := hmac.New(DefaultHashNew, key)
mac.Write(buf)
h, err := HashFromRaw(DefaultHashType, mac.Sum(nil))
if err != nil {
return HMAC{}, err
}
return HMAC{h}, nil
} | [
"func",
"DefaultHMAC",
"(",
"key",
",",
"buf",
"[",
"]",
"byte",
")",
"(",
"HMAC",
",",
"error",
")",
"{",
"mac",
":=",
"hmac",
".",
"New",
"(",
"DefaultHashNew",
",",
"key",
")",
"\n",
"mac",
".",
"Write",
"(",
"buf",
")",
"\n",
"h",
",",
"err... | // DefaultHMAC computes the HMAC with the given key of the given data
// using the default hash. | [
"DefaultHMAC",
"computes",
"the",
"HMAC",
"with",
"the",
"given",
"key",
"of",
"the",
"given",
"data",
"using",
"the",
"default",
"hash",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L300-L308 |
161,327 | keybase/client | go/kbfs/kbfshash/hash.go | MarshalBinary | func (hmac HMAC) MarshalBinary() (data []byte, err error) {
return hmac.h.MarshalBinary()
} | go | func (hmac HMAC) MarshalBinary() (data []byte, err error) {
return hmac.h.MarshalBinary()
} | [
"func",
"(",
"hmac",
"HMAC",
")",
"MarshalBinary",
"(",
")",
"(",
"data",
"[",
"]",
"byte",
",",
"err",
"error",
")",
"{",
"return",
"hmac",
".",
"h",
".",
"MarshalBinary",
"(",
")",
"\n",
"}"
] | // MarshalBinary implements the encoding.BinaryMarshaler interface for
// HMAC. Returns an error if the HMAC is invalid and not the zero
// HMAC. | [
"MarshalBinary",
"implements",
"the",
"encoding",
".",
"BinaryMarshaler",
"interface",
"for",
"HMAC",
".",
"Returns",
"an",
"error",
"if",
"the",
"HMAC",
"is",
"invalid",
"and",
"not",
"the",
"zero",
"HMAC",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L336-L338 |
161,328 | keybase/client | go/kbfs/kbfshash/hash.go | UnmarshalBinary | func (hmac *HMAC) UnmarshalBinary(data []byte) error {
return hmac.h.UnmarshalBinary(data)
} | go | func (hmac *HMAC) UnmarshalBinary(data []byte) error {
return hmac.h.UnmarshalBinary(data)
} | [
"func",
"(",
"hmac",
"*",
"HMAC",
")",
"UnmarshalBinary",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"return",
"hmac",
".",
"h",
".",
"UnmarshalBinary",
"(",
"data",
")",
"\n",
"}"
] | // UnmarshalBinary implements the encoding.BinaryUnmarshaler interface
// for HMAC. Returns an error if the given byte array is non-empty and
// the HMAC is invalid. | [
"UnmarshalBinary",
"implements",
"the",
"encoding",
".",
"BinaryUnmarshaler",
"interface",
"for",
"HMAC",
".",
"Returns",
"an",
"error",
"if",
"the",
"given",
"byte",
"array",
"is",
"non",
"-",
"empty",
"and",
"the",
"HMAC",
"is",
"invalid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L343-L345 |
161,329 | keybase/client | go/kbfs/kbfshash/hash.go | UnmarshalText | func (hmac *HMAC) UnmarshalText(data []byte) error {
return hmac.h.UnmarshalText(data)
} | go | func (hmac *HMAC) UnmarshalText(data []byte) error {
return hmac.h.UnmarshalText(data)
} | [
"func",
"(",
"hmac",
"*",
"HMAC",
")",
"UnmarshalText",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"return",
"hmac",
".",
"h",
".",
"UnmarshalText",
"(",
"data",
")",
"\n",
"}"
] | // UnmarshalText implements the encoding.TextUnmarshaler interface
// for HMAC. | [
"UnmarshalText",
"implements",
"the",
"encoding",
".",
"TextUnmarshaler",
"interface",
"for",
"HMAC",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L355-L357 |
161,330 | keybase/client | go/kbfs/kbfshash/hash.go | Verify | func (hmac HMAC) Verify(key, buf []byte) error {
if !hmac.IsValid() {
return errors.WithStack(InvalidHashError{hmac.h})
}
// Once we have multiple hash types we'll need to expand this.
t := hmac.hashType()
if t != DefaultHashType {
return errors.WithStack(UnknownHashTypeError{t})
}
expectedHMAC, err := Def... | go | func (hmac HMAC) Verify(key, buf []byte) error {
if !hmac.IsValid() {
return errors.WithStack(InvalidHashError{hmac.h})
}
// Once we have multiple hash types we'll need to expand this.
t := hmac.hashType()
if t != DefaultHashType {
return errors.WithStack(UnknownHashTypeError{t})
}
expectedHMAC, err := Def... | [
"func",
"(",
"hmac",
"HMAC",
")",
"Verify",
"(",
"key",
",",
"buf",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"!",
"hmac",
".",
"IsValid",
"(",
")",
"{",
"return",
"errors",
".",
"WithStack",
"(",
"InvalidHashError",
"{",
"hmac",
".",
"h",
"}",
... | // Verify makes sure that the HMAC matches the given data. | [
"Verify",
"makes",
"sure",
"that",
"the",
"HMAC",
"matches",
"the",
"given",
"data",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/kbfshash/hash.go#L360-L380 |
161,331 | keybase/client | go/kbfs/libfuse/sync_from_server_file.go | Write | func (f *SyncFromServerFile) Write(ctx context.Context, req *fuse.WriteRequest,
resp *fuse.WriteResponse) (err error) {
f.folder.fs.log.CDebugf(ctx, "SyncFromServerFile Write")
defer func() { err = f.folder.processError(ctx, libkbfs.WriteMode, err) }()
if len(req.Data) == 0 {
return nil
}
folderBranch := f.fold... | go | func (f *SyncFromServerFile) Write(ctx context.Context, req *fuse.WriteRequest,
resp *fuse.WriteResponse) (err error) {
f.folder.fs.log.CDebugf(ctx, "SyncFromServerFile Write")
defer func() { err = f.folder.processError(ctx, libkbfs.WriteMode, err) }()
if len(req.Data) == 0 {
return nil
}
folderBranch := f.fold... | [
"func",
"(",
"f",
"*",
"SyncFromServerFile",
")",
"Write",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"WriteRequest",
",",
"resp",
"*",
"fuse",
".",
"WriteResponse",
")",
"(",
"err",
"error",
")",
"{",
"f",
".",
"folder",
".... | // Write implements the fs.HandleWriter interface for SyncFromServerFile. | [
"Write",
"implements",
"the",
"fs",
".",
"HandleWriter",
"interface",
"for",
"SyncFromServerFile",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/sync_from_server_file.go#L47-L72 |
161,332 | keybase/client | go/protocol/keybase1/rekey_ui.go | Refresh | func (c RekeyUIClient) Refresh(ctx context.Context, __arg RefreshArg) (err error) {
err = c.Cli.Call(ctx, "keybase.1.rekeyUI.refresh", []interface{}{__arg}, nil)
return
} | go | func (c RekeyUIClient) Refresh(ctx context.Context, __arg RefreshArg) (err error) {
err = c.Cli.Call(ctx, "keybase.1.rekeyUI.refresh", []interface{}{__arg}, nil)
return
} | [
"func",
"(",
"c",
"RekeyUIClient",
")",
"Refresh",
"(",
"ctx",
"context",
".",
"Context",
",",
"__arg",
"RefreshArg",
")",
"(",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"Call",
"(",
"ctx",
",",
"\"",
"\"",
",",
"[",
"]",
"inter... | // Refresh is called whenever Electron should refresh the UI, either
// because a change came in, or because there was a timeout poll. | [
"Refresh",
"is",
"called",
"whenever",
"Electron",
"should",
"refresh",
"the",
"UI",
"either",
"because",
"a",
"change",
"came",
"in",
"or",
"because",
"there",
"was",
"a",
"timeout",
"poll",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/rekey_ui.go#L152-L155 |
161,333 | keybase/client | go/protocol/keybase1/rekey_ui.go | RekeySendEvent | func (c RekeyUIClient) RekeySendEvent(ctx context.Context, __arg RekeySendEventArg) (err error) {
err = c.Cli.Notify(ctx, "keybase.1.rekeyUI.rekeySendEvent", []interface{}{__arg})
return
} | go | func (c RekeyUIClient) RekeySendEvent(ctx context.Context, __arg RekeySendEventArg) (err error) {
err = c.Cli.Notify(ctx, "keybase.1.rekeyUI.rekeySendEvent", []interface{}{__arg})
return
} | [
"func",
"(",
"c",
"RekeyUIClient",
")",
"RekeySendEvent",
"(",
"ctx",
"context",
".",
"Context",
",",
"__arg",
"RekeySendEventArg",
")",
"(",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"Notify",
"(",
"ctx",
",",
"\"",
"\"",
",",
"[",... | // RekeySendEvent sends updates as to what's going on in the rekey
// thread. This is mainly useful in testing. | [
"RekeySendEvent",
"sends",
"updates",
"as",
"to",
"what",
"s",
"going",
"on",
"in",
"the",
"rekey",
"thread",
".",
"This",
"is",
"mainly",
"useful",
"in",
"testing",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/keybase1/rekey_ui.go#L159-L162 |
161,334 | keybase/client | go/kbfs/libfuse/dir.go | fillAttrWithUIDAndWritePerm | func (f *Folder) fillAttrWithUIDAndWritePerm(
ctx context.Context, node libkbfs.Node, ei *data.EntryInfo,
a *fuse.Attr) (err error) {
a.Valid = 1 * time.Minute
node.FillCacheDuration(&a.Valid)
a.Size = ei.Size
a.Blocks = getNumBlocksFromSize(ei.Size)
a.Mtime = time.Unix(0, ei.Mtime)
a.Ctime = time.Unix(0, ei.C... | go | func (f *Folder) fillAttrWithUIDAndWritePerm(
ctx context.Context, node libkbfs.Node, ei *data.EntryInfo,
a *fuse.Attr) (err error) {
a.Valid = 1 * time.Minute
node.FillCacheDuration(&a.Valid)
a.Size = ei.Size
a.Blocks = getNumBlocksFromSize(ei.Size)
a.Mtime = time.Unix(0, ei.Mtime)
a.Ctime = time.Unix(0, ei.C... | [
"func",
"(",
"f",
"*",
"Folder",
")",
"fillAttrWithUIDAndWritePerm",
"(",
"ctx",
"context",
".",
"Context",
",",
"node",
"libkbfs",
".",
"Node",
",",
"ei",
"*",
"data",
".",
"EntryInfo",
",",
"a",
"*",
"fuse",
".",
"Attr",
")",
"(",
"err",
"error",
"... | // fillAttrWithUIDAndWritePerm sets attributes based on the entry info, and
// pops in correct UID and write permissions. It only handles fields common to
// all entryinfo types. | [
"fillAttrWithUIDAndWritePerm",
"sets",
"attributes",
"based",
"on",
"the",
"entry",
"info",
"and",
"pops",
"in",
"correct",
"UID",
"and",
"write",
"permissions",
".",
"It",
"only",
"handles",
"fields",
"common",
"to",
"all",
"entryinfo",
"types",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L374-L392 |
161,335 | keybase/client | go/kbfs/libfuse/dir.go | Access | func (d *Dir) Access(ctx context.Context, r *fuse.AccessRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Access", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
return d.folder.access(ctx, r)
} | go | func (d *Dir) Access(ctx context.Context, r *fuse.AccessRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Access", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
return d.folder.access(ctx, r)
} | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Access",
"(",
"ctx",
"context",
".",
"Context",
",",
"r",
"*",
"fuse",
".",
"AccessRequest",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",
"config",
".",
"MaybeStartTrace",
... | // Access implements the fs.NodeAccesser interface for File. See comment for
// File.Access for more details. | [
"Access",
"implements",
"the",
"fs",
".",
"NodeAccesser",
"interface",
"for",
"File",
".",
"See",
"comment",
"for",
"File",
".",
"Access",
"for",
"more",
"details",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L481-L487 |
161,336 | keybase/client | go/kbfs/libfuse/dir.go | Attr | func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Attr", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Attr")
defer func() { err = d.folder.processError(ctx... | go | func (d *Dir) Attr(ctx context.Context, a *fuse.Attr) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Attr", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Attr")
defer func() { err = d.folder.processError(ctx... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Attr",
"(",
"ctx",
"context",
".",
"Context",
",",
"a",
"*",
"fuse",
".",
"Attr",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",
"config",
".",
"MaybeStartTrace",
"(",
"ct... | // Attr implements the fs.Node interface for Dir. | [
"Attr",
"implements",
"the",
"fs",
".",
"Node",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L490-L506 |
161,337 | keybase/client | go/kbfs/libfuse/dir.go | Create | func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fs.Node, handle fs.Handle, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Create",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }... | go | func (d *Dir) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (node fs.Node, handle fs.Handle, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Create",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Create",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"CreateRequest",
",",
"resp",
"*",
"fuse",
".",
"CreateResponse",
")",
"(",
"node",
"fs",
".",
"Node",
",",
"handle",
"fs",
".",
"Hand... | // Create implements the fs.NodeCreater interface for Dir. | [
"Create",
"implements",
"the",
"fs",
".",
"NodeCreater",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L626-L658 |
161,338 | keybase/client | go/kbfs/libfuse/dir.go | Mkdir | func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (
node fs.Node, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Mkdir",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, ... | go | func (d *Dir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (
node fs.Node, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Mkdir",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, ... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Mkdir",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"MkdirRequest",
")",
"(",
"node",
"fs",
".",
"Node",
",",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",... | // Mkdir implements the fs.NodeMkdirer interface for Dir. | [
"Mkdir",
"implements",
"the",
"fs",
".",
"NodeMkdirer",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L661-L688 |
161,339 | keybase/client | go/kbfs/libfuse/dir.go | Symlink | func (d *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (
node fs.Node, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Symlink",
fmt.Sprintf("%s %s -> %s", d.node.GetBasename(),
req.NewName, req.Target))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs... | go | func (d *Dir) Symlink(ctx context.Context, req *fuse.SymlinkRequest) (
node fs.Node, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Symlink",
fmt.Sprintf("%s %s -> %s", d.node.GetBasename(),
req.NewName, req.Target))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Symlink",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"SymlinkRequest",
")",
"(",
"node",
"fs",
".",
"Node",
",",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
... | // Symlink implements the fs.NodeSymlinker interface for Dir. | [
"Symlink",
"implements",
"the",
"fs",
".",
"NodeSymlinker",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L691-L720 |
161,340 | keybase/client | go/kbfs/libfuse/dir.go | Rename | func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest,
newDir fs.Node) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Rename",
fmt.Sprintf("%s %s -> %s", d.node.GetBasename(),
req.OldName, req.NewName))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.... | go | func (d *Dir) Rename(ctx context.Context, req *fuse.RenameRequest,
newDir fs.Node) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Rename",
fmt.Sprintf("%s %s -> %s", d.node.GetBasename(),
req.OldName, req.NewName))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Rename",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"RenameRequest",
",",
"newDir",
"fs",
".",
"Node",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
... | // Rename implements the fs.NodeRenamer interface for Dir. | [
"Rename",
"implements",
"the",
"fs",
".",
"NodeRenamer",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L723-L774 |
161,341 | keybase/client | go/kbfs/libfuse/dir.go | Remove | func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Remove",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Remove %... | go | func (d *Dir) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Remove",
fmt.Sprintf("%s %s", d.node.GetBasename(), req.Name))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Remove %... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Remove",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"RemoveRequest",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",
"config",
".",
"MaybeStartTrace",... | // Remove implements the fs.NodeRemover interface for Dir. | [
"Remove",
"implements",
"the",
"fs",
".",
"NodeRemover",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L777-L805 |
161,342 | keybase/client | go/kbfs/libfuse/dir.go | ReadDirAll | func (d *Dir) ReadDirAll(ctx context.Context) (res []fuse.Dirent, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.ReadDirAll", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir ReadDirAll")
defer func() { err = d.... | go | func (d *Dir) ReadDirAll(ctx context.Context) (res []fuse.Dirent, err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.ReadDirAll", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir ReadDirAll")
defer func() { err = d.... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"ReadDirAll",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"res",
"[",
"]",
"fuse",
".",
"Dirent",
",",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",
"config",
".",
"MaybeStartTra... | // ReadDirAll implements the fs.NodeReadDirAller interface for Dir. | [
"ReadDirAll",
"implements",
"the",
"fs",
".",
"NodeReadDirAller",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L808-L843 |
161,343 | keybase/client | go/kbfs/libfuse/dir.go | Setattr | func (d *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error) {
valid := req.Valid
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Setattr",
fmt.Sprintf("%s %s", d.node.GetBasename(), valid))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.fold... | go | func (d *Dir) Setattr(ctx context.Context, req *fuse.SetattrRequest, resp *fuse.SetattrResponse) (err error) {
valid := req.Valid
ctx = d.folder.fs.config.MaybeStartTrace(ctx, "Dir.Setattr",
fmt.Sprintf("%s %s", d.node.GetBasename(), valid))
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.fold... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Setattr",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"SetattrRequest",
",",
"resp",
"*",
"fuse",
".",
"SetattrResponse",
")",
"(",
"err",
"error",
")",
"{",
"valid",
":=",
"req",
".",
"V... | // Setattr implements the fs.NodeSetattrer interface for Dir. | [
"Setattr",
"implements",
"the",
"fs",
".",
"NodeSetattrer",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L851-L908 |
161,344 | keybase/client | go/kbfs/libfuse/dir.go | Fsync | func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Fsync", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Fsync")
defer func() { err = d.folder.pro... | go | func (d *Dir) Fsync(ctx context.Context, req *fuse.FsyncRequest) (err error) {
ctx = d.folder.fs.config.MaybeStartTrace(
ctx, "Dir.Fsync", d.node.GetBasename())
defer func() { d.folder.fs.config.MaybeFinishTrace(ctx, err) }()
d.folder.fs.vlog.CLogf(ctx, libkb.VLog1, "Dir Fsync")
defer func() { err = d.folder.pro... | [
"func",
"(",
"d",
"*",
"Dir",
")",
"Fsync",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"FsyncRequest",
")",
"(",
"err",
"error",
")",
"{",
"ctx",
"=",
"d",
".",
"folder",
".",
"fs",
".",
"config",
".",
"MaybeStartTrace",
... | // Fsync implements the fs.NodeFsyncer interface for Dir. | [
"Fsync",
"implements",
"the",
"fs",
".",
"NodeFsyncer",
"interface",
"for",
"Dir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/dir.go#L911-L927 |
161,345 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | cancelExistingLocked | func (cr *ConflictResolver) cancelExistingLocked(ci conflictInput) bool {
// The input is only interesting if one of the revisions is
// greater than what we've looked at to date.
if ci.unmerged <= cr.currInput.unmerged &&
ci.merged <= cr.currInput.merged {
return false
}
if cr.currCancel != nil {
cr.currCan... | go | func (cr *ConflictResolver) cancelExistingLocked(ci conflictInput) bool {
// The input is only interesting if one of the revisions is
// greater than what we've looked at to date.
if ci.unmerged <= cr.currInput.unmerged &&
ci.merged <= cr.currInput.merged {
return false
}
if cr.currCancel != nil {
cr.currCan... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"cancelExistingLocked",
"(",
"ci",
"conflictInput",
")",
"bool",
"{",
"// The input is only interesting if one of the revisions is",
"// greater than what we've looked at to date.",
"if",
"ci",
".",
"unmerged",
"<=",
"cr",
".... | // cancelExistingLocked must be called while holding cr.inputLock. | [
"cancelExistingLocked",
"must",
"be",
"called",
"while",
"holding",
"cr",
".",
"inputLock",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L176-L187 |
161,346 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | ForceCancel | func (cr *ConflictResolver) ForceCancel() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if cr.currCancel != nil {
cr.currCancel()
}
} | go | func (cr *ConflictResolver) ForceCancel() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if cr.currCancel != nil {
cr.currCancel()
}
} | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"ForceCancel",
"(",
")",
"{",
"cr",
".",
"inputLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"cr",
".",
"inputLock",
".",
"Unlock",
"(",
")",
"\n",
"if",
"cr",
".",
"currCancel",
"!=",
"nil",
"{",
"cr... | // ForceCancel cancels any currently-running CR, regardless of what
// its inputs were. | [
"ForceCancel",
"cancels",
"any",
"currently",
"-",
"running",
"CR",
"regardless",
"of",
"what",
"its",
"inputs",
"were",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L191-L197 |
161,347 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | processInput | func (cr *ConflictResolver) processInput(baseCtx context.Context,
inputChan <-chan conflictInput) {
// Start off with a closed prevCRDone, so that the first CR call
// doesn't have to wait.
prevCRDone := make(chan struct{})
close(prevCRDone)
defer func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if... | go | func (cr *ConflictResolver) processInput(baseCtx context.Context,
inputChan <-chan conflictInput) {
// Start off with a closed prevCRDone, so that the first CR call
// doesn't have to wait.
prevCRDone := make(chan struct{})
close(prevCRDone)
defer func() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
if... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"processInput",
"(",
"baseCtx",
"context",
".",
"Context",
",",
"inputChan",
"<-",
"chan",
"conflictInput",
")",
"{",
"// Start off with a closed prevCRDone, so that the first CR call",
"// doesn't have to wait.",
"prevCRDone... | // processInput processes conflict resolution jobs from the given
// channel until it is closed. This function uses a parameter for the
// channel instead of accessing cr.inputChan directly so that it
// doesn't have to hold inputChanLock. | [
"processInput",
"processes",
"conflict",
"resolution",
"jobs",
"from",
"the",
"given",
"channel",
"until",
"it",
"is",
"closed",
".",
"This",
"function",
"uses",
"a",
"parameter",
"for",
"the",
"channel",
"instead",
"of",
"accessing",
"cr",
".",
"inputChan",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L203-L257 |
161,348 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | Resolve | func (cr *ConflictResolver) Resolve(ctx context.Context,
unmerged kbfsmd.Revision, merged kbfsmd.Revision) {
cr.inputChanLock.RLock()
defer cr.inputChanLock.RUnlock()
// CR can end up trying to cancel itself via the SyncAll call, so
// prevent that from happening.
if crOpID := ctx.Value(CtxCRIDKey); crOpID != ni... | go | func (cr *ConflictResolver) Resolve(ctx context.Context,
unmerged kbfsmd.Revision, merged kbfsmd.Revision) {
cr.inputChanLock.RLock()
defer cr.inputChanLock.RUnlock()
// CR can end up trying to cancel itself via the SyncAll call, so
// prevent that from happening.
if crOpID := ctx.Value(CtxCRIDKey); crOpID != ni... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"Resolve",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmerged",
"kbfsmd",
".",
"Revision",
",",
"merged",
"kbfsmd",
".",
"Revision",
")",
"{",
"cr",
".",
"inputChanLock",
".",
"RLock",
"(",
")",
"\n",
... | // Resolve takes the latest known unmerged and merged revision
// numbers, and kicks off the resolution process. | [
"Resolve",
"takes",
"the",
"latest",
"known",
"unmerged",
"and",
"merged",
"revision",
"numbers",
"and",
"kicks",
"off",
"the",
"resolution",
"process",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L261-L296 |
161,349 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | BeginNewBranch | func (cr *ConflictResolver) BeginNewBranch() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Reset the curr input so we don't ignore a future CR
// request that uses the same revision number (i.e.,
// because the previous CR failed to flush due to a
// conflict).
cr.currInput = conflictInput{}
} | go | func (cr *ConflictResolver) BeginNewBranch() {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// Reset the curr input so we don't ignore a future CR
// request that uses the same revision number (i.e.,
// because the previous CR failed to flush due to a
// conflict).
cr.currInput = conflictInput{}
} | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"BeginNewBranch",
"(",
")",
"{",
"cr",
".",
"inputLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"cr",
".",
"inputLock",
".",
"Unlock",
"(",
")",
"\n",
"// Reset the curr input so we don't ignore a future CR",
"//... | // BeginNewBranch resets any internal state to be ready to accept
// resolutions from a new branch. | [
"BeginNewBranch",
"resets",
"any",
"internal",
"state",
"to",
"be",
"ready",
"to",
"accept",
"resolutions",
"from",
"a",
"new",
"branch",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L325-L333 |
161,350 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | updateCurrInput | func (cr *ConflictResolver) updateCurrInput(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (err error) {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// check done while holding the lock, so we know for sure if
// we've already been canceled and replaced by a new input.
err = cr.checkDone(ctx)
... | go | func (cr *ConflictResolver) updateCurrInput(ctx context.Context,
unmerged, merged []ImmutableRootMetadata) (err error) {
cr.inputLock.Lock()
defer cr.inputLock.Unlock()
// check done while holding the lock, so we know for sure if
// we've already been canceled and replaced by a new input.
err = cr.checkDone(ctx)
... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"updateCurrInput",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmerged",
",",
"merged",
"[",
"]",
"ImmutableRootMetadata",
")",
"(",
"err",
"error",
")",
"{",
"cr",
".",
"inputLock",
".",
"Lock",
"(",
")... | // updateCurrInput assumes that both unmerged and merged are
// non-empty. | [
"updateCurrInput",
"assumes",
"that",
"both",
"unmerged",
"and",
"merged",
"are",
"non",
"-",
"empty",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L413-L463 |
161,351 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | Less | func (sp crSortedPaths) Less(i, j int) bool {
return len(sp[i].Path) > len(sp[j].Path)
} | go | func (sp crSortedPaths) Less(i, j int) bool {
return len(sp[i].Path) > len(sp[j].Path)
} | [
"func",
"(",
"sp",
"crSortedPaths",
")",
"Less",
"(",
"i",
",",
"j",
"int",
")",
"bool",
"{",
"return",
"len",
"(",
"sp",
"[",
"i",
"]",
".",
"Path",
")",
">",
"len",
"(",
"sp",
"[",
"j",
"]",
".",
"Path",
")",
"\n",
"}"
] | // Less implements sort.Interface for crSortedPaths | [
"Less",
"implements",
"sort",
".",
"Interface",
"for",
"crSortedPaths"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L523-L525 |
161,352 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | Swap | func (sp crSortedPaths) Swap(i, j int) {
sp[j], sp[i] = sp[i], sp[j]
} | go | func (sp crSortedPaths) Swap(i, j int) {
sp[j], sp[i] = sp[i], sp[j]
} | [
"func",
"(",
"sp",
"crSortedPaths",
")",
"Swap",
"(",
"i",
",",
"j",
"int",
")",
"{",
"sp",
"[",
"j",
"]",
",",
"sp",
"[",
"i",
"]",
"=",
"sp",
"[",
"i",
"]",
",",
"sp",
"[",
"j",
"]",
"\n",
"}"
] | // Swap implements sort.Interface for crSortedPaths | [
"Swap",
"implements",
"sort",
".",
"Interface",
"for",
"crSortedPaths"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L528-L530 |
161,353 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | createdFileWithNonzeroSizes | func (cr *ConflictResolver) createdFileWithNonzeroSizes(
ctx context.Context, unmergedChains, mergedChains *crChains,
unmergedChain *crChain, mergedChain *crChain,
unmergedCop, mergedCop *createOp) (bool, error) {
lState := makeFBOLockState()
// The pointers on the ops' final paths aren't necessarily filled
// in... | go | func (cr *ConflictResolver) createdFileWithNonzeroSizes(
ctx context.Context, unmergedChains, mergedChains *crChains,
unmergedChain *crChain, mergedChain *crChain,
unmergedCop, mergedCop *createOp) (bool, error) {
lState := makeFBOLockState()
// The pointers on the ops' final paths aren't necessarily filled
// in... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"createdFileWithNonzeroSizes",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
"unmergedChain",
"*",
"crChain",
",",
"mergedChain",
"*",
"crChain",
",",
"un... | // createdFileWithNonzeroSizes checks two possibly-conflicting
// createOps and returns true if the corresponding file has non-zero
// directory entry sizes in both the unmerged and merged branch. We
// need to check this sometimes, because a call to
// `createdFileWithConflictingWrite` might not have access to syncOp... | [
"createdFileWithNonzeroSizes",
"checks",
"two",
"possibly",
"-",
"conflicting",
"createOps",
"and",
"returns",
"true",
"if",
"the",
"corresponding",
"file",
"has",
"non",
"-",
"zero",
"directory",
"entry",
"sizes",
"in",
"both",
"the",
"unmerged",
"and",
"merged",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L574-L620 |
161,354 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | findCreatedDirsToMerge | func (cr *ConflictResolver) findCreatedDirsToMerge(ctx context.Context,
unmergedPaths []data.Path, unmergedChains, mergedChains *crChains) (
[]data.Path, error) {
var newUnmergedPaths []data.Path
for _, unmergedPath := range unmergedPaths {
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedPath.TailPoin... | go | func (cr *ConflictResolver) findCreatedDirsToMerge(ctx context.Context,
unmergedPaths []data.Path, unmergedChains, mergedChains *crChains) (
[]data.Path, error) {
var newUnmergedPaths []data.Path
for _, unmergedPath := range unmergedPaths {
unmergedChain, ok :=
unmergedChains.byMostRecent[unmergedPath.TailPoin... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"findCreatedDirsToMerge",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmergedPaths",
"[",
"]",
"data",
".",
"Path",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
")",
"(",
"[",
"]",
"data",
... | // findCreatedDirsToMerge finds directories that were created in both
// the unmerged and merged branches, and resets the original unmerged
// pointer to match the original merged pointer. It returns a slice of
// new unmerged paths that need to be combined with the unmergedPaths
// slice. | [
"findCreatedDirsToMerge",
"finds",
"directories",
"that",
"were",
"created",
"in",
"both",
"the",
"unmerged",
"and",
"merged",
"branches",
"and",
"resets",
"the",
"original",
"unmerged",
"pointer",
"to",
"match",
"the",
"original",
"merged",
"pointer",
".",
"It",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L768-L788 |
161,355 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | addChildBlocksIfIndirectFile | func (cr *ConflictResolver) addChildBlocksIfIndirectFile(
ctx context.Context, lState *kbfssync.LockState, unmergedChains *crChains,
currPath data.Path, op op) error {
// For files with indirect pointers, add all child blocks
// as refblocks for the re-created file.
infos, err := cr.fbo.blocks.GetIndirectFileBlock... | go | func (cr *ConflictResolver) addChildBlocksIfIndirectFile(
ctx context.Context, lState *kbfssync.LockState, unmergedChains *crChains,
currPath data.Path, op op) error {
// For files with indirect pointers, add all child blocks
// as refblocks for the re-created file.
infos, err := cr.fbo.blocks.GetIndirectFileBlock... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"addChildBlocksIfIndirectFile",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"unmergedChains",
"*",
"crChains",
",",
"currPath",
"data",
".",
"Path",
",",
"op",
... | // addChildBlocksIfIndirectFile adds refblocks for all child blocks of
// the given file. It will return an error if called with a pointer
// that doesn't represent a file. | [
"addChildBlocksIfIndirectFile",
"adds",
"refblocks",
"for",
"all",
"child",
"blocks",
"of",
"the",
"given",
"file",
".",
"It",
"will",
"return",
"an",
"error",
"if",
"called",
"with",
"a",
"pointer",
"that",
"doesn",
"t",
"represent",
"a",
"file",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L798-L816 |
161,356 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | addRecreateOpsToUnmergedChains | func (cr *ConflictResolver) addRecreateOpsToUnmergedChains(ctx context.Context,
recreateOps []*createOp, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) ([]data.Path, error) {
if len(recreateOps) == 0 {
return nil, nil
}
// First create a lookup table that maps every block p... | go | func (cr *ConflictResolver) addRecreateOpsToUnmergedChains(ctx context.Context,
recreateOps []*createOp, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) ([]data.Path, error) {
if len(recreateOps) == 0 {
return nil, nil
}
// First create a lookup table that maps every block p... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"addRecreateOpsToUnmergedChains",
"(",
"ctx",
"context",
".",
"Context",
",",
"recreateOps",
"[",
"]",
"*",
"createOp",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
"mergedPaths",
"map",
"[",
... | // addRecreateOpsToUnmergedChains inserts each recreateOp, into its
// appropriate unmerged chain, creating one if it doesn't exist yet.
// It also adds entries as necessary to mergedPaths, and returns a
// slice of new unmergedPaths to be added. | [
"addRecreateOpsToUnmergedChains",
"inserts",
"each",
"recreateOp",
"into",
"its",
"appropriate",
"unmerged",
"chain",
"creating",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"yet",
".",
"It",
"also",
"adds",
"entries",
"as",
"necessary",
"to",
"mergedPaths",
"and",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L1349-L1415 |
161,357 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | addMergedRecreates | func (cr *ConflictResolver) addMergedRecreates(ctx context.Context,
unmergedChains, mergedChains *crChains,
mostRecentMergedWriterInfo writerInfo) error {
for _, unmergedChain := range unmergedChains.byMostRecent {
// First check for nodes that have been deleted in the unmerged
// branch, but modified in the mer... | go | func (cr *ConflictResolver) addMergedRecreates(ctx context.Context,
unmergedChains, mergedChains *crChains,
mostRecentMergedWriterInfo writerInfo) error {
for _, unmergedChain := range unmergedChains.byMostRecent {
// First check for nodes that have been deleted in the unmerged
// branch, but modified in the mer... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"addMergedRecreates",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
"mostRecentMergedWriterInfo",
"writerInfo",
")",
"error",
"{",
"for",
"_",
",",
"unmer... | // addMergedRecreates drops any unmerged operations that remove a node
// that was modified in the merged branch, and adds a create op to the
// merged chain so that the node will be re-created locally. | [
"addMergedRecreates",
"drops",
"any",
"unmerged",
"operations",
"that",
"remove",
"a",
"node",
"that",
"was",
"modified",
"in",
"the",
"merged",
"branch",
"and",
"adds",
"a",
"create",
"op",
"to",
"the",
"merged",
"chain",
"so",
"that",
"the",
"node",
"will"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L1994-L2082 |
161,358 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | getActionsToMerge | func (cr *ConflictResolver) getActionsToMerge(
ctx context.Context, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) (
map[data.BlockPointer]crActionList, error) {
actionMap := make(map[data.BlockPointer]crActionList)
for unmergedMostRecent, unmergedChain := range unmergedChains... | go | func (cr *ConflictResolver) getActionsToMerge(
ctx context.Context, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) (
map[data.BlockPointer]crActionList, error) {
actionMap := make(map[data.BlockPointer]crActionList)
for unmergedMostRecent, unmergedChain := range unmergedChains... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"getActionsToMerge",
"(",
"ctx",
"context",
".",
"Context",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
"mergedPaths",
"map",
"[",
"data",
".",
"BlockPointer",
"]",
"data",
".",
"Path",
"... | // getActionsToMerge returns the set of actions needed to merge each
// unmerged chain of operations, in a map keyed by the tail pointer of
// the corresponding merged path. | [
"getActionsToMerge",
"returns",
"the",
"set",
"of",
"actions",
"needed",
"to",
"merge",
"each",
"unmerged",
"chain",
"of",
"operations",
"in",
"a",
"map",
"keyed",
"by",
"the",
"tail",
"pointer",
"of",
"the",
"corresponding",
"merged",
"path",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L2087-L2127 |
161,359 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | createResolvedMD | func (cr *ConflictResolver) createResolvedMD(ctx context.Context,
lState *kbfssync.LockState, unmergedPaths []data.Path,
unmergedChains, mergedChains *crChains,
mostRecentMergedMD ImmutableRootMetadata) (*RootMetadata, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
newMD, err := mostRecen... | go | func (cr *ConflictResolver) createResolvedMD(ctx context.Context,
lState *kbfssync.LockState, unmergedPaths []data.Path,
unmergedChains, mergedChains *crChains,
mostRecentMergedMD ImmutableRootMetadata) (*RootMetadata, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
newMD, err := mostRecen... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"createResolvedMD",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"unmergedPaths",
"[",
"]",
"data",
".",
"Path",
",",
"unmergedChains",
",",
"mergedChains",
"*"... | // createResolvedMD creates a MD update that will be merged into the
// main folder as the resolving commit. It contains all of the
// unmerged operations, as well as a "dummy" operation at the end
// which will catch all of the BlockPointer updates. A later phase
// will move all of those updates into their proper l... | [
"createResolvedMD",
"creates",
"a",
"MD",
"update",
"that",
"will",
"be",
"merged",
"into",
"the",
"main",
"folder",
"as",
"the",
"resolving",
"commit",
".",
"It",
"contains",
"all",
"of",
"the",
"unmerged",
"operations",
"as",
"well",
"as",
"a",
"dummy",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L2703-L2791 |
161,360 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | makePostResolutionPaths | func (cr *ConflictResolver) makePostResolutionPaths(ctx context.Context,
md *RootMetadata, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) (map[data.BlockPointer]data.Path, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
session, err := cr.config.KBPKI()... | go | func (cr *ConflictResolver) makePostResolutionPaths(ctx context.Context,
md *RootMetadata, unmergedChains, mergedChains *crChains,
mergedPaths map[data.BlockPointer]data.Path) (map[data.BlockPointer]data.Path, error) {
err := cr.checkDone(ctx)
if err != nil {
return nil, err
}
session, err := cr.config.KBPKI()... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"makePostResolutionPaths",
"(",
"ctx",
"context",
".",
"Context",
",",
"md",
"*",
"RootMetadata",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
"mergedPaths",
"map",
"[",
"data",
".",
"BlockP... | // makePostResolutionPaths returns the full paths to each unmerged
// pointer, taking into account any rename operations that occurred in
// the merged branch. | [
"makePostResolutionPaths",
"returns",
"the",
"full",
"paths",
"to",
"each",
"unmerged",
"pointer",
"taking",
"into",
"account",
"any",
"rename",
"operations",
"that",
"occurred",
"in",
"the",
"merged",
"branch",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L2907-L2948 |
161,361 | keybase/client | go/kbfs/libkbfs/conflict_resolver.go | finalizeResolution | func (cr *ConflictResolver) finalizeResolution(ctx context.Context,
lState *kbfssync.LockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[data.BlockPointer]data.BlockPointer,
bps blockPutState, blocksToDelete []kbfsblock.ID, writerLocked bool) error {
err := cr.checkDone(ctx)
if err !=... | go | func (cr *ConflictResolver) finalizeResolution(ctx context.Context,
lState *kbfssync.LockState, md *RootMetadata,
unmergedChains, mergedChains *crChains,
updates map[data.BlockPointer]data.BlockPointer,
bps blockPutState, blocksToDelete []kbfsblock.ID, writerLocked bool) error {
err := cr.checkDone(ctx)
if err !=... | [
"func",
"(",
"cr",
"*",
"ConflictResolver",
")",
"finalizeResolution",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"md",
"*",
"RootMetadata",
",",
"unmergedChains",
",",
"mergedChains",
"*",
"crChains",
",",
... | // finalizeResolution finishes the resolution process, making the
// resolution visible to any nodes on the merged branch, and taking
// the local node out of staged mode. | [
"finalizeResolution",
"finishes",
"the",
"resolution",
"process",
"making",
"the",
"resolution",
"visible",
"to",
"any",
"nodes",
"on",
"the",
"merged",
"branch",
"and",
"taking",
"the",
"local",
"node",
"out",
"of",
"staged",
"mode",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/conflict_resolver.go#L3076-L3105 |
161,362 | keybase/client | go/kbfs/tlfhandle/path.go | BuildCanonicalPathForTlfType | func BuildCanonicalPathForTlfType(t tlf.Type, paths ...string) string {
var pathType PathType
switch t {
case tlf.Private:
pathType = PrivatePathType
case tlf.Public:
pathType = PublicPathType
case tlf.SingleTeam:
pathType = SingleTeamPathType
default:
panic(fmt.Sprintf("Unknown tlf path type: %d", t))
}... | go | func BuildCanonicalPathForTlfType(t tlf.Type, paths ...string) string {
var pathType PathType
switch t {
case tlf.Private:
pathType = PrivatePathType
case tlf.Public:
pathType = PublicPathType
case tlf.SingleTeam:
pathType = SingleTeamPathType
default:
panic(fmt.Sprintf("Unknown tlf path type: %d", t))
}... | [
"func",
"BuildCanonicalPathForTlfType",
"(",
"t",
"tlf",
".",
"Type",
",",
"paths",
"...",
"string",
")",
"string",
"{",
"var",
"pathType",
"PathType",
"\n",
"switch",
"t",
"{",
"case",
"tlf",
".",
"Private",
":",
"pathType",
"=",
"PrivatePathType",
"\n",
... | // BuildCanonicalPathForTlfType is like BuildCanonicalPath, but accepts a
// tlf.Type instead of PathhType. | [
"BuildCanonicalPathForTlfType",
"is",
"like",
"BuildCanonicalPath",
"but",
"accepts",
"a",
"tlf",
".",
"Type",
"instead",
"of",
"PathhType",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlfhandle/path.go#L53-L67 |
161,363 | keybase/client | go/kbfs/tlfhandle/path.go | BuildCanonicalPathForTlfName | func BuildCanonicalPathForTlfName(t tlf.Type, tlfName tlf.CanonicalName) string {
return BuildCanonicalPathForTlfType(t, string(tlfName))
} | go | func BuildCanonicalPathForTlfName(t tlf.Type, tlfName tlf.CanonicalName) string {
return BuildCanonicalPathForTlfType(t, string(tlfName))
} | [
"func",
"BuildCanonicalPathForTlfName",
"(",
"t",
"tlf",
".",
"Type",
",",
"tlfName",
"tlf",
".",
"CanonicalName",
")",
"string",
"{",
"return",
"BuildCanonicalPathForTlfType",
"(",
"t",
",",
"string",
"(",
"tlfName",
")",
")",
"\n",
"}"
] | // BuildCanonicalPathForTlfName returns a canonical path for a tlf. | [
"BuildCanonicalPathForTlfName",
"returns",
"a",
"canonical",
"path",
"for",
"a",
"tlf",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlfhandle/path.go#L70-L72 |
161,364 | keybase/client | go/kbfs/tlfhandle/path.go | BuildCanonicalPathForTlf | func BuildCanonicalPathForTlf(tlf tlf.ID, paths ...string) string {
return BuildCanonicalPathForTlfType(tlf.Type(), paths...)
} | go | func BuildCanonicalPathForTlf(tlf tlf.ID, paths ...string) string {
return BuildCanonicalPathForTlfType(tlf.Type(), paths...)
} | [
"func",
"BuildCanonicalPathForTlf",
"(",
"tlf",
"tlf",
".",
"ID",
",",
"paths",
"...",
"string",
")",
"string",
"{",
"return",
"BuildCanonicalPathForTlfType",
"(",
"tlf",
".",
"Type",
"(",
")",
",",
"paths",
"...",
")",
"\n",
"}"
] | // BuildCanonicalPathForTlf returns a canonical path for a tlf. Although tlf
// identifies a TLF, paths should still include the TLF name. This function
// does not try to canonicalize TLF names. | [
"BuildCanonicalPathForTlf",
"returns",
"a",
"canonical",
"path",
"for",
"a",
"tlf",
".",
"Although",
"tlf",
"identifies",
"a",
"TLF",
"paths",
"should",
"still",
"include",
"the",
"TLF",
"name",
".",
"This",
"function",
"does",
"not",
"try",
"to",
"canonicaliz... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlfhandle/path.go#L77-L79 |
161,365 | keybase/client | go/protocol/gregor1/incoming.go | ConsumeMessageMulti | func (c IncomingClient) ConsumeMessageMulti(ctx context.Context, __arg ConsumeMessageMultiArg) (err error) {
err = c.Cli.CallCompressed(ctx, "gregor.1.incoming.consumeMessageMulti", []interface{}{__arg}, nil, rpc.CompressionGzip)
return
} | go | func (c IncomingClient) ConsumeMessageMulti(ctx context.Context, __arg ConsumeMessageMultiArg) (err error) {
err = c.Cli.CallCompressed(ctx, "gregor.1.incoming.consumeMessageMulti", []interface{}{__arg}, nil, rpc.CompressionGzip)
return
} | [
"func",
"(",
"c",
"IncomingClient",
")",
"ConsumeMessageMulti",
"(",
"ctx",
"context",
".",
"Context",
",",
"__arg",
"ConsumeMessageMultiArg",
")",
"(",
"err",
"error",
")",
"{",
"err",
"=",
"c",
".",
"Cli",
".",
"CallCompressed",
"(",
"ctx",
",",
"\"",
... | // consumeMessageMulti will take msg and consume it for all the users listed
// in uids. This is so a gregor client can send the same message to many UIDs
// with one call, as opposed to calling consumeMessage for each UID. | [
"consumeMessageMulti",
"will",
"take",
"msg",
"and",
"consume",
"it",
"for",
"all",
"the",
"users",
"listed",
"in",
"uids",
".",
"This",
"is",
"so",
"a",
"gregor",
"client",
"can",
"send",
"the",
"same",
"message",
"to",
"many",
"UIDs",
"with",
"one",
"c... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/protocol/gregor1/incoming.go#L321-L324 |
161,366 | keybase/client | go/client/cmd_pgp_gen.go | Run | func (v *CmdPGPGen) Run() (err error) {
protocols := []rpc.Protocol{
NewSecretUIProtocol(v.G()),
}
cli, err := GetPGPClient(v.G())
if err != nil {
return err
}
user, err := GetUserClient(v.G())
if err != nil {
return err
}
if err = RegisterProtocolsWithContext(protocols, v.G()); err != nil {
return er... | go | func (v *CmdPGPGen) Run() (err error) {
protocols := []rpc.Protocol{
NewSecretUIProtocol(v.G()),
}
cli, err := GetPGPClient(v.G())
if err != nil {
return err
}
user, err := GetUserClient(v.G())
if err != nil {
return err
}
if err = RegisterProtocolsWithContext(protocols, v.G()); err != nil {
return er... | [
"func",
"(",
"v",
"*",
"CmdPGPGen",
")",
"Run",
"(",
")",
"(",
"err",
"error",
")",
"{",
"protocols",
":=",
"[",
"]",
"rpc",
".",
"Protocol",
"{",
"NewSecretUIProtocol",
"(",
"v",
".",
"G",
"(",
")",
")",
",",
"}",
"\n",
"cli",
",",
"err",
":="... | // Why use CreatePGPIDs rather than MakeAllIds? | [
"Why",
"use",
"CreatePGPIDs",
"rather",
"than",
"MakeAllIds?"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_pgp_gen.go#L45-L91 |
161,367 | keybase/client | go/kbfs/idutil/data_types.go | ResetInfo | func (rki RevokedKeyInfo) ResetInfo() (keybase1.Seqno, bool) {
return rki.resetSeqno, rki.isReset
} | go | func (rki RevokedKeyInfo) ResetInfo() (keybase1.Seqno, bool) {
return rki.resetSeqno, rki.isReset
} | [
"func",
"(",
"rki",
"RevokedKeyInfo",
")",
"ResetInfo",
"(",
")",
"(",
"keybase1",
".",
"Seqno",
",",
"bool",
")",
"{",
"return",
"rki",
".",
"resetSeqno",
",",
"rki",
".",
"isReset",
"\n",
"}"
] | // ResetInfo returns, if this key belongs to an account before it was
// reset, data about that reset. | [
"ResetInfo",
"returns",
"if",
"this",
"key",
"belongs",
"to",
"an",
"account",
"before",
"it",
"was",
"reset",
"data",
"about",
"that",
"reset",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/idutil/data_types.go#L61-L63 |
161,368 | keybase/client | go/kbfs/idutil/data_types.go | SetResetInfo | func (rki *RevokedKeyInfo) SetResetInfo(seqno keybase1.Seqno, isReset bool) {
rki.resetSeqno = seqno
rki.isReset = isReset
} | go | func (rki *RevokedKeyInfo) SetResetInfo(seqno keybase1.Seqno, isReset bool) {
rki.resetSeqno = seqno
rki.isReset = isReset
} | [
"func",
"(",
"rki",
"*",
"RevokedKeyInfo",
")",
"SetResetInfo",
"(",
"seqno",
"keybase1",
".",
"Seqno",
",",
"isReset",
"bool",
")",
"{",
"rki",
".",
"resetSeqno",
"=",
"seqno",
"\n",
"rki",
".",
"isReset",
"=",
"isReset",
"\n",
"}"
] | // SetResetInfo sets, if this key belongs to an account before it was
// reset, data about that reset. | [
"SetResetInfo",
"sets",
"if",
"this",
"key",
"belongs",
"to",
"an",
"account",
"before",
"it",
"was",
"reset",
"data",
"about",
"that",
"reset",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/idutil/data_types.go#L67-L70 |
161,369 | keybase/client | go/kbfs/idutil/data_types.go | DeepCopy | func (ui UserInfo) DeepCopy() UserInfo {
copyUI := ui
copyUI.VerifyingKeys = make(
[]kbfscrypto.VerifyingKey, len(ui.VerifyingKeys))
copy(copyUI.VerifyingKeys, ui.VerifyingKeys)
copyUI.CryptPublicKeys = make(
[]kbfscrypto.CryptPublicKey, len(ui.CryptPublicKeys))
copy(copyUI.CryptPublicKeys, ui.CryptPublicKeys)... | go | func (ui UserInfo) DeepCopy() UserInfo {
copyUI := ui
copyUI.VerifyingKeys = make(
[]kbfscrypto.VerifyingKey, len(ui.VerifyingKeys))
copy(copyUI.VerifyingKeys, ui.VerifyingKeys)
copyUI.CryptPublicKeys = make(
[]kbfscrypto.CryptPublicKey, len(ui.CryptPublicKeys))
copy(copyUI.CryptPublicKeys, ui.CryptPublicKeys)... | [
"func",
"(",
"ui",
"UserInfo",
")",
"DeepCopy",
"(",
")",
"UserInfo",
"{",
"copyUI",
":=",
"ui",
"\n",
"copyUI",
".",
"VerifyingKeys",
"=",
"make",
"(",
"[",
"]",
"kbfscrypto",
".",
"VerifyingKey",
",",
"len",
"(",
"ui",
".",
"VerifyingKeys",
")",
")",... | // DeepCopy returns a copy of `ui`, including deep copies of all slice
// and map members. | [
"DeepCopy",
"returns",
"a",
"copy",
"of",
"ui",
"including",
"deep",
"copies",
"of",
"all",
"slice",
"and",
"map",
"members",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/idutil/data_types.go#L89-L114 |
161,370 | keybase/client | go/kbfs/libfs/error_file.go | GetEncodedErrors | func GetEncodedErrors(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error) {
return func(_ context.Context) ([]byte, time.Time, error) {
errors := config.Reporter().AllKnownErrors()
jsonErrors := make([]JSONReportedError, len(errors))
for i, e := range errors {
jsonErrors[i].Time = e.Time
... | go | func GetEncodedErrors(config libkbfs.Config) func(context.Context) ([]byte, time.Time, error) {
return func(_ context.Context) ([]byte, time.Time, error) {
errors := config.Reporter().AllKnownErrors()
jsonErrors := make([]JSONReportedError, len(errors))
for i, e := range errors {
jsonErrors[i].Time = e.Time
... | [
"func",
"GetEncodedErrors",
"(",
"config",
"libkbfs",
".",
"Config",
")",
"func",
"(",
"context",
".",
"Context",
")",
"(",
"[",
"]",
"byte",
",",
"time",
".",
"Time",
",",
"error",
")",
"{",
"return",
"func",
"(",
"_",
"context",
".",
"Context",
")"... | // GetEncodedErrors gets the list of encoded errors in a format suitable
// for error file. | [
"GetEncodedErrors",
"gets",
"the",
"list",
"of",
"encoded",
"errors",
"in",
"a",
"format",
"suitable",
"for",
"error",
"file",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfs/error_file.go#L34-L50 |
161,371 | keybase/client | go/mounter/mounter_osx.go | cstr | func cstr(ca []int8) string {
s := make([]byte, 0, len(ca))
for _, c := range ca {
if c == 0x00 {
break
}
s = append(s, byte(c))
}
return string(s)
} | go | func cstr(ca []int8) string {
s := make([]byte, 0, len(ca))
for _, c := range ca {
if c == 0x00 {
break
}
s = append(s, byte(c))
}
return string(s)
} | [
"func",
"cstr",
"(",
"ca",
"[",
"]",
"int8",
")",
"string",
"{",
"s",
":=",
"make",
"(",
"[",
"]",
"byte",
",",
"0",
",",
"len",
"(",
"ca",
")",
")",
"\n",
"for",
"_",
",",
"c",
":=",
"range",
"ca",
"{",
"if",
"c",
"==",
"0x00",
"{",
"bre... | // cstr converts a nil-terminated C string into a Go string | [
"cstr",
"converts",
"a",
"nil",
"-",
"terminated",
"C",
"string",
"into",
"a",
"Go",
"string"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/mounter/mounter_osx.go#L42-L51 |
161,372 | keybase/client | go/chat/storage/storage.go | Merge | func (s *Storage) Merge(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) (res MergeResult, err Error) {
defer s.Trace(ctx, func() error { return err }, "Merge")()
return s.MergeHelper(ctx, convID, uid, msgs, nil)
} | go | func (s *Storage) Merge(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) (res MergeResult, err Error) {
defer s.Trace(ctx, func() error { return err }, "Merge")()
return s.MergeHelper(ctx, convID, uid, msgs, nil)
} | [
"func",
"(",
"s",
"*",
"Storage",
")",
"Merge",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"msgs",
"[",
"]",
"chat1",
".",
"MessageUnboxed",
")",
"(",
"res",
"MergeResul... | // Merge requires msgs to be sorted by descending message ID | [
"Merge",
"requires",
"msgs",
"to",
"be",
"sorted",
"by",
"descending",
"message",
"ID"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L378-L382 |
161,373 | keybase/client | go/chat/storage/storage.go | applyExpunge | func (s *Storage) applyExpunge(ctx context.Context, convID chat1.ConversationID,
uid gregor1.UID, expunge chat1.Expunge) (*chat1.Expunge, Error) {
s.Debug(ctx, "applyExpunge(%v, %v, %v)", convID, uid, expunge.Upto)
de := func(format string, args ...interface{}) {
s.Debug(ctx, "applyExpunge: "+fmt.Sprintf(format,... | go | func (s *Storage) applyExpunge(ctx context.Context, convID chat1.ConversationID,
uid gregor1.UID, expunge chat1.Expunge) (*chat1.Expunge, Error) {
s.Debug(ctx, "applyExpunge(%v, %v, %v)", convID, uid, expunge.Upto)
de := func(format string, args ...interface{}) {
s.Debug(ctx, "applyExpunge: "+fmt.Sprintf(format,... | [
"func",
"(",
"s",
"*",
"Storage",
")",
"applyExpunge",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"expunge",
"chat1",
".",
"Expunge",
")",
"(",
"*",
"chat1",
".",
"Expun... | // Apply a delete history.
// Returns a non-nil expunge if deletes happened.
// Always runs through local messages. | [
"Apply",
"a",
"delete",
"history",
".",
"Returns",
"a",
"non",
"-",
"nil",
"expunge",
"if",
"deletes",
"happened",
".",
"Always",
"runs",
"through",
"local",
"messages",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L760-L824 |
161,374 | keybase/client | go/chat/storage/storage.go | clearUpthrough | func (s *Storage) clearUpthrough(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID,
upthrough chat1.MessageID) (err Error) {
defer s.Trace(ctx, func() error { return err }, "clearUpthrough")()
key, ierr := GetSecretBoxKey(ctx, s.G().ExternalG(), DefaultSecretUI)
if ierr != nil {
return MiscError{M... | go | func (s *Storage) clearUpthrough(ctx context.Context, convID chat1.ConversationID, uid gregor1.UID,
upthrough chat1.MessageID) (err Error) {
defer s.Trace(ctx, func() error { return err }, "clearUpthrough")()
key, ierr := GetSecretBoxKey(ctx, s.G().ExternalG(), DefaultSecretUI)
if ierr != nil {
return MiscError{M... | [
"func",
"(",
"s",
"*",
"Storage",
")",
"clearUpthrough",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"upthrough",
"chat1",
".",
"MessageID",
")",
"(",
"err",
"Error",
")",
... | // clearUpthrough clears up to the given message ID, inclusive | [
"clearUpthrough",
"clears",
"up",
"to",
"the",
"given",
"message",
"ID",
"inclusive"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L827-L844 |
161,375 | keybase/client | go/chat/storage/storage.go | updateReactionIDs | func (s *Storage) updateReactionIDs(reactionIDs []chat1.MessageID, msgid chat1.MessageID) ([]chat1.MessageID, bool) {
for _, reactionID := range reactionIDs {
if reactionID == msgid {
return reactionIDs, false
}
}
return append(reactionIDs, msgid), true
} | go | func (s *Storage) updateReactionIDs(reactionIDs []chat1.MessageID, msgid chat1.MessageID) ([]chat1.MessageID, bool) {
for _, reactionID := range reactionIDs {
if reactionID == msgid {
return reactionIDs, false
}
}
return append(reactionIDs, msgid), true
} | [
"func",
"(",
"s",
"*",
"Storage",
")",
"updateReactionIDs",
"(",
"reactionIDs",
"[",
"]",
"chat1",
".",
"MessageID",
",",
"msgid",
"chat1",
".",
"MessageID",
")",
"(",
"[",
"]",
"chat1",
".",
"MessageID",
",",
"bool",
")",
"{",
"for",
"_",
",",
"reac... | // updateReactionIDs appends `msgid` to `reactionIDs` if it is not already
// present. | [
"updateReactionIDs",
"appends",
"msgid",
"to",
"reactionIDs",
"if",
"it",
"is",
"not",
"already",
"present",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L1184-L1191 |
161,376 | keybase/client | go/chat/storage/storage.go | updateReactionTargetOnDelete | func (s *Storage) updateReactionTargetOnDelete(ctx context.Context, convID chat1.ConversationID,
uid gregor1.UID, reactionMsg *chat1.MessageUnboxed) (*chat1.MessageUnboxed, bool, Error) {
s.Debug(ctx, "updateReactionTargetOnDelete: reationMsg: %v", reactionMsg)
if reactionMsg.Valid().MessageBody.IsNil() {
return ... | go | func (s *Storage) updateReactionTargetOnDelete(ctx context.Context, convID chat1.ConversationID,
uid gregor1.UID, reactionMsg *chat1.MessageUnboxed) (*chat1.MessageUnboxed, bool, Error) {
s.Debug(ctx, "updateReactionTargetOnDelete: reationMsg: %v", reactionMsg)
if reactionMsg.Valid().MessageBody.IsNil() {
return ... | [
"func",
"(",
"s",
"*",
"Storage",
")",
"updateReactionTargetOnDelete",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"reactionMsg",
"*",
"chat1",
".",
"MessageUnboxed",
")",
"(",... | // updateReactionTargetOnDelete modifies the reaction's target message when the
// reaction itself is deleted | [
"updateReactionTargetOnDelete",
"modifies",
"the",
"reaction",
"s",
"target",
"message",
"when",
"the",
"reaction",
"itself",
"is",
"deleted"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L1195-L1222 |
161,377 | keybase/client | go/chat/storage/storage.go | purgeMessage | func (s *Storage) purgeMessage(mvalid chat1.MessageUnboxedValid) (chat1.MessageUnboxed, []chat1.Asset) {
assets := utils.AssetsForMessage(s.G(), mvalid.MessageBody)
var emptyBody chat1.MessageBody
mvalid.MessageBody = emptyBody
var emptyReactions chat1.ReactionMap
mvalid.Reactions = emptyReactions
return chat1.Ne... | go | func (s *Storage) purgeMessage(mvalid chat1.MessageUnboxedValid) (chat1.MessageUnboxed, []chat1.Asset) {
assets := utils.AssetsForMessage(s.G(), mvalid.MessageBody)
var emptyBody chat1.MessageBody
mvalid.MessageBody = emptyBody
var emptyReactions chat1.ReactionMap
mvalid.Reactions = emptyReactions
return chat1.Ne... | [
"func",
"(",
"s",
"*",
"Storage",
")",
"purgeMessage",
"(",
"mvalid",
"chat1",
".",
"MessageUnboxedValid",
")",
"(",
"chat1",
".",
"MessageUnboxed",
",",
"[",
"]",
"chat1",
".",
"Asset",
")",
"{",
"assets",
":=",
"utils",
".",
"AssetsForMessage",
"(",
"s... | // Clears the body of a message and returns any assets to be deleted. | [
"Clears",
"the",
"body",
"of",
"a",
"message",
"and",
"returns",
"any",
"assets",
"to",
"be",
"deleted",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/storage/storage.go#L1225-L1232 |
161,378 | keybase/client | go/kbfs/libkbfs/ops.go | AddRefBlock | func (oc *OpCommon) AddRefBlock(ptr data.BlockPointer) {
oc.RefBlocks = append(oc.RefBlocks, ptr)
} | go | func (oc *OpCommon) AddRefBlock(ptr data.BlockPointer) {
oc.RefBlocks = append(oc.RefBlocks, ptr)
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"AddRefBlock",
"(",
"ptr",
"data",
".",
"BlockPointer",
")",
"{",
"oc",
".",
"RefBlocks",
"=",
"append",
"(",
"oc",
".",
"RefBlocks",
",",
"ptr",
")",
"\n",
"}"
] | // AddRefBlock adds this block to the list of newly-referenced blocks
// for this op. | [
"AddRefBlock",
"adds",
"this",
"block",
"to",
"the",
"list",
"of",
"newly",
"-",
"referenced",
"blocks",
"for",
"this",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L195-L197 |
161,379 | keybase/client | go/kbfs/libkbfs/ops.go | DelRefBlock | func (oc *OpCommon) DelRefBlock(ptr data.BlockPointer) {
for i, ref := range oc.RefBlocks {
if ptr == ref {
oc.RefBlocks = append(oc.RefBlocks[:i], oc.RefBlocks[i+1:]...)
break
}
}
} | go | func (oc *OpCommon) DelRefBlock(ptr data.BlockPointer) {
for i, ref := range oc.RefBlocks {
if ptr == ref {
oc.RefBlocks = append(oc.RefBlocks[:i], oc.RefBlocks[i+1:]...)
break
}
}
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"DelRefBlock",
"(",
"ptr",
"data",
".",
"BlockPointer",
")",
"{",
"for",
"i",
",",
"ref",
":=",
"range",
"oc",
".",
"RefBlocks",
"{",
"if",
"ptr",
"==",
"ref",
"{",
"oc",
".",
"RefBlocks",
"=",
"append",
"("... | // DelRefBlock removes the first reference of the given block from the
// list of newly-referenced blocks for this op. | [
"DelRefBlock",
"removes",
"the",
"first",
"reference",
"of",
"the",
"given",
"block",
"from",
"the",
"list",
"of",
"newly",
"-",
"referenced",
"blocks",
"for",
"this",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L201-L208 |
161,380 | keybase/client | go/kbfs/libkbfs/ops.go | AddUnrefBlock | func (oc *OpCommon) AddUnrefBlock(ptr data.BlockPointer) {
oc.UnrefBlocks = append(oc.UnrefBlocks, ptr)
} | go | func (oc *OpCommon) AddUnrefBlock(ptr data.BlockPointer) {
oc.UnrefBlocks = append(oc.UnrefBlocks, ptr)
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"AddUnrefBlock",
"(",
"ptr",
"data",
".",
"BlockPointer",
")",
"{",
"oc",
".",
"UnrefBlocks",
"=",
"append",
"(",
"oc",
".",
"UnrefBlocks",
",",
"ptr",
")",
"\n",
"}"
] | // AddUnrefBlock adds this block to the list of newly-unreferenced blocks
// for this op. | [
"AddUnrefBlock",
"adds",
"this",
"block",
"to",
"the",
"list",
"of",
"newly",
"-",
"unreferenced",
"blocks",
"for",
"this",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L212-L214 |
161,381 | keybase/client | go/kbfs/libkbfs/ops.go | DelUnrefBlock | func (oc *OpCommon) DelUnrefBlock(ptr data.BlockPointer) {
for i, unref := range oc.UnrefBlocks {
if ptr == unref {
oc.UnrefBlocks = append(oc.UnrefBlocks[:i], oc.UnrefBlocks[i+1:]...)
break
}
}
} | go | func (oc *OpCommon) DelUnrefBlock(ptr data.BlockPointer) {
for i, unref := range oc.UnrefBlocks {
if ptr == unref {
oc.UnrefBlocks = append(oc.UnrefBlocks[:i], oc.UnrefBlocks[i+1:]...)
break
}
}
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"DelUnrefBlock",
"(",
"ptr",
"data",
".",
"BlockPointer",
")",
"{",
"for",
"i",
",",
"unref",
":=",
"range",
"oc",
".",
"UnrefBlocks",
"{",
"if",
"ptr",
"==",
"unref",
"{",
"oc",
".",
"UnrefBlocks",
"=",
"appe... | // DelUnrefBlock removes the first unreference of the given block from
// the list of unreferenced blocks for this op. | [
"DelUnrefBlock",
"removes",
"the",
"first",
"unreference",
"of",
"the",
"given",
"block",
"from",
"the",
"list",
"of",
"unreferenced",
"blocks",
"for",
"this",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L218-L225 |
161,382 | keybase/client | go/kbfs/libkbfs/ops.go | AddUpdate | func (oc *OpCommon) AddUpdate(oldPtr data.BlockPointer, newPtr data.BlockPointer) {
// Either pointer may be zero, if we're building an op that
// will be fixed up later.
bu := blockUpdate{oldPtr, newPtr}
oc.Updates = append(oc.Updates, bu)
} | go | func (oc *OpCommon) AddUpdate(oldPtr data.BlockPointer, newPtr data.BlockPointer) {
// Either pointer may be zero, if we're building an op that
// will be fixed up later.
bu := blockUpdate{oldPtr, newPtr}
oc.Updates = append(oc.Updates, bu)
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"AddUpdate",
"(",
"oldPtr",
"data",
".",
"BlockPointer",
",",
"newPtr",
"data",
".",
"BlockPointer",
")",
"{",
"// Either pointer may be zero, if we're building an op that",
"// will be fixed up later.",
"bu",
":=",
"blockUpdate"... | // AddUpdate adds a mapping from an old block to the new version of
// that block, for this op. | [
"AddUpdate",
"adds",
"a",
"mapping",
"from",
"an",
"old",
"block",
"to",
"the",
"new",
"version",
"of",
"that",
"block",
"for",
"this",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L229-L234 |
161,383 | keybase/client | go/kbfs/libkbfs/ops.go | ToEditNotification | func (oc *OpCommon) ToEditNotification(
_ kbfsmd.Revision, _ time.Time, _ kbfscrypto.VerifyingKey,
_ keybase1.UID, _ tlf.ID) *kbfsedits.NotificationMessage {
// Ops embedding this that can be converted should override this.
return nil
} | go | func (oc *OpCommon) ToEditNotification(
_ kbfsmd.Revision, _ time.Time, _ kbfscrypto.VerifyingKey,
_ keybase1.UID, _ tlf.ID) *kbfsedits.NotificationMessage {
// Ops embedding this that can be converted should override this.
return nil
} | [
"func",
"(",
"oc",
"*",
"OpCommon",
")",
"ToEditNotification",
"(",
"_",
"kbfsmd",
".",
"Revision",
",",
"_",
"time",
".",
"Time",
",",
"_",
"kbfscrypto",
".",
"VerifyingKey",
",",
"_",
"keybase1",
".",
"UID",
",",
"_",
"tlf",
".",
"ID",
")",
"*",
... | // ToEditNotification implements the op interface for OpCommon. | [
"ToEditNotification",
"implements",
"the",
"op",
"interface",
"for",
"OpCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L305-L310 |
161,384 | keybase/client | go/kbfs/libkbfs/ops.go | End | func (w WriteRange) End() uint64 {
if w.isTruncate() {
panic("Truncates don't have an end")
}
return w.Off + w.Len
} | go | func (w WriteRange) End() uint64 {
if w.isTruncate() {
panic("Truncates don't have an end")
}
return w.Off + w.Len
} | [
"func",
"(",
"w",
"WriteRange",
")",
"End",
"(",
")",
"uint64",
"{",
"if",
"w",
".",
"isTruncate",
"(",
")",
"{",
"panic",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"return",
"w",
".",
"Off",
"+",
"w",
".",
"Len",
"\n",
"}"
] | // End returns the index of the largest byte not affected by this
// write. It only makes sense to call this for non-truncates. | [
"End",
"returns",
"the",
"index",
"of",
"the",
"largest",
"byte",
"not",
"affected",
"by",
"this",
"write",
".",
"It",
"only",
"makes",
"sense",
"to",
"call",
"this",
"for",
"non",
"-",
"truncates",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L810-L815 |
161,385 | keybase/client | go/kbfs/libkbfs/ops.go | SizeExceptUpdates | func (gco *GCOp) SizeExceptUpdates() uint64 {
return data.BPSize * uint64(len(gco.UnrefBlocks))
} | go | func (gco *GCOp) SizeExceptUpdates() uint64 {
return data.BPSize * uint64(len(gco.UnrefBlocks))
} | [
"func",
"(",
"gco",
"*",
"GCOp",
")",
"SizeExceptUpdates",
"(",
")",
"uint64",
"{",
"return",
"data",
".",
"BPSize",
"*",
"uint64",
"(",
"len",
"(",
"gco",
".",
"UnrefBlocks",
")",
")",
"\n",
"}"
] | // SizeExceptUpdates implements op. | [
"SizeExceptUpdates",
"implements",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L1432-L1434 |
161,386 | keybase/client | go/kbfs/libkbfs/ops.go | StringWithRefs | func (gco *GCOp) StringWithRefs(indent string) string {
res := gco.String() + "\n"
res += gco.stringWithRefs(indent)
return res
} | go | func (gco *GCOp) StringWithRefs(indent string) string {
res := gco.String() + "\n"
res += gco.stringWithRefs(indent)
return res
} | [
"func",
"(",
"gco",
"*",
"GCOp",
")",
"StringWithRefs",
"(",
"indent",
"string",
")",
"string",
"{",
"res",
":=",
"gco",
".",
"String",
"(",
")",
"+",
"\"",
"\\n",
"\"",
"\n",
"res",
"+=",
"gco",
".",
"stringWithRefs",
"(",
"indent",
")",
"\n",
"re... | // StringWithRefs implements the op interface for GCOp. | [
"StringWithRefs",
"implements",
"the",
"op",
"interface",
"for",
"GCOp",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L1449-L1453 |
161,387 | keybase/client | go/kbfs/libkbfs/ops.go | checkConflict | func (gco *GCOp) checkConflict(
ctx context.Context, renamer ConflictRenamer, mergedOp op,
isFile bool) (crAction, error) {
return nil, nil
} | go | func (gco *GCOp) checkConflict(
ctx context.Context, renamer ConflictRenamer, mergedOp op,
isFile bool) (crAction, error) {
return nil, nil
} | [
"func",
"(",
"gco",
"*",
"GCOp",
")",
"checkConflict",
"(",
"ctx",
"context",
".",
"Context",
",",
"renamer",
"ConflictRenamer",
",",
"mergedOp",
"op",
",",
"isFile",
"bool",
")",
"(",
"crAction",
",",
"error",
")",
"{",
"return",
"nil",
",",
"nil",
"\... | // checkConflict implements op. | [
"checkConflict",
"implements",
"op",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L1456-L1460 |
161,388 | keybase/client | go/kbfs/libkbfs/ops.go | RegisterOps | func RegisterOps(codec kbfscodec.Codec) {
codec.RegisterType(reflect.TypeOf(createOp{}), createOpCode)
codec.RegisterType(reflect.TypeOf(rmOp{}), rmOpCode)
codec.RegisterType(reflect.TypeOf(renameOp{}), renameOpCode)
codec.RegisterType(reflect.TypeOf(syncOp{}), syncOpCode)
codec.RegisterType(reflect.TypeOf(setAttr... | go | func RegisterOps(codec kbfscodec.Codec) {
codec.RegisterType(reflect.TypeOf(createOp{}), createOpCode)
codec.RegisterType(reflect.TypeOf(rmOp{}), rmOpCode)
codec.RegisterType(reflect.TypeOf(renameOp{}), renameOpCode)
codec.RegisterType(reflect.TypeOf(syncOp{}), syncOpCode)
codec.RegisterType(reflect.TypeOf(setAttr... | [
"func",
"RegisterOps",
"(",
"codec",
"kbfscodec",
".",
"Codec",
")",
"{",
"codec",
".",
"RegisterType",
"(",
"reflect",
".",
"TypeOf",
"(",
"createOp",
"{",
"}",
")",
",",
"createOpCode",
")",
"\n",
"codec",
".",
"RegisterType",
"(",
"reflect",
".",
"Typ... | // RegisterOps registers all op types with the given codec. | [
"RegisterOps",
"registers",
"all",
"op",
"types",
"with",
"the",
"given",
"codec",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/ops.go#L1563-L1574 |
161,389 | keybase/client | go/service/account.go | EnterResetPipeline | func (h *AccountHandler) EnterResetPipeline(ctx context.Context, arg keybase1.EnterResetPipelineArg) (err error) {
mctx := libkb.NewMetaContext(ctx, h.G())
defer mctx.TraceTimed("EnterResetPipline", func() error { return err })()
uis := libkb.UIs{
LoginUI: h.getLoginUI(arg.SessionID),
SecretUI: h.getSecretUI(... | go | func (h *AccountHandler) EnterResetPipeline(ctx context.Context, arg keybase1.EnterResetPipelineArg) (err error) {
mctx := libkb.NewMetaContext(ctx, h.G())
defer mctx.TraceTimed("EnterResetPipline", func() error { return err })()
uis := libkb.UIs{
LoginUI: h.getLoginUI(arg.SessionID),
SecretUI: h.getSecretUI(... | [
"func",
"(",
"h",
"*",
"AccountHandler",
")",
"EnterResetPipeline",
"(",
"ctx",
"context",
".",
"Context",
",",
"arg",
"keybase1",
".",
"EnterResetPipelineArg",
")",
"(",
"err",
"error",
")",
"{",
"mctx",
":=",
"libkb",
".",
"NewMetaContext",
"(",
"ctx",
"... | // EnterPipeline allows a user to enter the reset pipeline. The user must
// verify ownership of the account via an email confirmation or their password.
// Resets are not allowed on a provisioned device. | [
"EnterPipeline",
"allows",
"a",
"user",
"to",
"enter",
"the",
"reset",
"pipeline",
".",
"The",
"user",
"must",
"verify",
"ownership",
"of",
"the",
"account",
"via",
"an",
"email",
"confirmation",
"or",
"their",
"password",
".",
"Resets",
"are",
"not",
"allow... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/account.go#L217-L229 |
161,390 | keybase/client | go/service/account.go | CancelReset | func (h *AccountHandler) CancelReset(ctx context.Context, sessionID int) error {
mctx := libkb.NewMetaContext(ctx, h.G())
return libkb.CancelResetPipeline(mctx)
} | go | func (h *AccountHandler) CancelReset(ctx context.Context, sessionID int) error {
mctx := libkb.NewMetaContext(ctx, h.G())
return libkb.CancelResetPipeline(mctx)
} | [
"func",
"(",
"h",
"*",
"AccountHandler",
")",
"CancelReset",
"(",
"ctx",
"context",
".",
"Context",
",",
"sessionID",
"int",
")",
"error",
"{",
"mctx",
":=",
"libkb",
".",
"NewMetaContext",
"(",
"ctx",
",",
"h",
".",
"G",
"(",
")",
")",
"\n",
"return... | // CancelReset allows a user to cancel the reset process via an authenticated API call. | [
"CancelReset",
"allows",
"a",
"user",
"to",
"cancel",
"the",
"reset",
"process",
"via",
"an",
"authenticated",
"API",
"call",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/service/account.go#L232-L235 |
161,391 | keybase/client | go/pvl/helpers.go | selectionText | func selectionText(selection *goquery.Selection) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
results = append(results, element.Text())
})
return strings.Join(results, " ")
} | go | func selectionText(selection *goquery.Selection) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
results = append(results, element.Text())
})
return strings.Join(results, " ")
} | [
"func",
"selectionText",
"(",
"selection",
"*",
"goquery",
".",
"Selection",
")",
"string",
"{",
"var",
"results",
"[",
"]",
"string",
"\n",
"selection",
".",
"Each",
"(",
"func",
"(",
"i",
"int",
",",
"element",
"*",
"goquery",
".",
"Selection",
")",
... | // selectionText gets the Text of all elements in a selection, concatenated by a space.
// The result can be an empty string. | [
"selectionText",
"gets",
"the",
"Text",
"of",
"all",
"elements",
"in",
"a",
"selection",
"concatenated",
"by",
"a",
"space",
".",
"The",
"result",
"can",
"be",
"an",
"empty",
"string",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/pvl/helpers.go#L68-L74 |
161,392 | keybase/client | go/pvl/helpers.go | selectionAttr | func selectionAttr(selection *goquery.Selection, attr string) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
res, ok := element.Attr(attr)
if ok {
results = append(results, res)
}
})
return strings.Join(results, " ")
} | go | func selectionAttr(selection *goquery.Selection, attr string) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
res, ok := element.Attr(attr)
if ok {
results = append(results, res)
}
})
return strings.Join(results, " ")
} | [
"func",
"selectionAttr",
"(",
"selection",
"*",
"goquery",
".",
"Selection",
",",
"attr",
"string",
")",
"string",
"{",
"var",
"results",
"[",
"]",
"string",
"\n",
"selection",
".",
"Each",
"(",
"func",
"(",
"i",
"int",
",",
"element",
"*",
"goquery",
... | // selectionAttr gets the specified attr of all elements in a selection, concatenated by a space.
// If getting the attr of any elements fails, that does not cause an error.
// The result can be an empty string. | [
"selectionAttr",
"gets",
"the",
"specified",
"attr",
"of",
"all",
"elements",
"in",
"a",
"selection",
"concatenated",
"by",
"a",
"space",
".",
"If",
"getting",
"the",
"attr",
"of",
"any",
"elements",
"fails",
"that",
"does",
"not",
"cause",
"an",
"error",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/pvl/helpers.go#L79-L88 |
161,393 | keybase/client | go/pvl/helpers.go | selectionData | func selectionData(selection *goquery.Selection) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
if len(element.Nodes) > 0 {
results = append(results, element.Nodes[0].Data)
}
})
return strings.Join(results, " ")
} | go | func selectionData(selection *goquery.Selection) string {
var results []string
selection.Each(func(i int, element *goquery.Selection) {
if len(element.Nodes) > 0 {
results = append(results, element.Nodes[0].Data)
}
})
return strings.Join(results, " ")
} | [
"func",
"selectionData",
"(",
"selection",
"*",
"goquery",
".",
"Selection",
")",
"string",
"{",
"var",
"results",
"[",
"]",
"string",
"\n",
"selection",
".",
"Each",
"(",
"func",
"(",
"i",
"int",
",",
"element",
"*",
"goquery",
".",
"Selection",
")",
... | // selectionData gets the first node's data of all elements in a selection, concatenated by a space.
// The result can be an empty string. | [
"selectionData",
"gets",
"the",
"first",
"node",
"s",
"data",
"of",
"all",
"elements",
"in",
"a",
"selection",
"concatenated",
"by",
"a",
"space",
".",
"The",
"result",
"can",
"be",
"an",
"empty",
"string",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/pvl/helpers.go#L92-L100 |
161,394 | keybase/client | go/pvl/helpers.go | validateDomain | func validateDomain(s string) bool {
// Throw a protocol in front because the parser wants one.
proto := "http"
u, err := url.Parse(proto + "://" + s)
if err != nil {
return false
}
// The final group must include a non-numeric character.
// To disallow the likes of "8.8.8.8."
dotsplit := strings.Split(strin... | go | func validateDomain(s string) bool {
// Throw a protocol in front because the parser wants one.
proto := "http"
u, err := url.Parse(proto + "://" + s)
if err != nil {
return false
}
// The final group must include a non-numeric character.
// To disallow the likes of "8.8.8.8."
dotsplit := strings.Split(strin... | [
"func",
"validateDomain",
"(",
"s",
"string",
")",
"bool",
"{",
"// Throw a protocol in front because the parser wants one.",
"proto",
":=",
"\"",
"\"",
"\n",
"u",
",",
"err",
":=",
"url",
".",
"Parse",
"(",
"proto",
"+",
"\"",
"\"",
"+",
"s",
")",
"\n",
"... | // Check that a url is valid and has only a domain and is not an ip.
// No port, path, protocol, user, query, or any other junk is allowed. | [
"Check",
"that",
"a",
"url",
"is",
"valid",
"and",
"has",
"only",
"a",
"domain",
"and",
"is",
"not",
"an",
"ip",
".",
"No",
"port",
"path",
"protocol",
"user",
"query",
"or",
"any",
"other",
"junk",
"is",
"allowed",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/pvl/helpers.go#L115-L145 |
161,395 | keybase/client | go/pvl/helpers.go | validateProtocol | func validateProtocol(s string, allowed []string) (string, bool) {
canons := map[string]string{
"http": "http",
"https": "https",
"dns": "dns",
"http:": "http",
"https:": "https",
"dns:": "dns",
"http://": "http",
"https://": "https",
"dns://": "dns",
}
canon, ok := canons[... | go | func validateProtocol(s string, allowed []string) (string, bool) {
canons := map[string]string{
"http": "http",
"https": "https",
"dns": "dns",
"http:": "http",
"https:": "https",
"dns:": "dns",
"http://": "http",
"https://": "https",
"dns://": "dns",
}
canon, ok := canons[... | [
"func",
"validateProtocol",
"(",
"s",
"string",
",",
"allowed",
"[",
"]",
"string",
")",
"(",
"string",
",",
"bool",
")",
"{",
"canons",
":=",
"map",
"[",
"string",
"]",
"string",
"{",
"\"",
"\"",
":",
"\"",
"\"",
",",
"\"",
"\"",
":",
"\"",
"\""... | // validateProtocol takes a protocol and returns the canonicalized form and whether it is valid. | [
"validateProtocol",
"takes",
"a",
"protocol",
"and",
"returns",
"the",
"canonicalized",
"form",
"and",
"whether",
"it",
"is",
"valid",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/pvl/helpers.go#L148-L166 |
161,396 | keybase/client | go/engine/puk_upgrade.go | NewPerUserKeyUpgrade | func NewPerUserKeyUpgrade(g *libkb.GlobalContext, args *PerUserKeyUpgradeArgs) *PerUserKeyUpgrade {
return &PerUserKeyUpgrade{
args: args,
Contextified: libkb.NewContextified(g),
}
} | go | func NewPerUserKeyUpgrade(g *libkb.GlobalContext, args *PerUserKeyUpgradeArgs) *PerUserKeyUpgrade {
return &PerUserKeyUpgrade{
args: args,
Contextified: libkb.NewContextified(g),
}
} | [
"func",
"NewPerUserKeyUpgrade",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"args",
"*",
"PerUserKeyUpgradeArgs",
")",
"*",
"PerUserKeyUpgrade",
"{",
"return",
"&",
"PerUserKeyUpgrade",
"{",
"args",
":",
"args",
",",
"Contextified",
":",
"libkb",
".",
"... | // NewPerUserKeyUpgrade creates a PerUserKeyUpgrade engine. | [
"NewPerUserKeyUpgrade",
"creates",
"a",
"PerUserKeyUpgrade",
"engine",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/puk_upgrade.go#L25-L30 |
161,397 | keybase/client | go/libkb/active_device.go | NewProvisionalActiveDevice | func NewProvisionalActiveDevice(m MetaContext, uv keybase1.UserVersion, d keybase1.DeviceID, sigKey GenericKey, encKey GenericKey, deviceName string) *ActiveDevice {
return &ActiveDevice{
uv: uv,
deviceID: d,
deviceName: deviceName,
signingKey: sigKey,
encryptionKey: encKey,
nistFacto... | go | func NewProvisionalActiveDevice(m MetaContext, uv keybase1.UserVersion, d keybase1.DeviceID, sigKey GenericKey, encKey GenericKey, deviceName string) *ActiveDevice {
return &ActiveDevice{
uv: uv,
deviceID: d,
deviceName: deviceName,
signingKey: sigKey,
encryptionKey: encKey,
nistFacto... | [
"func",
"NewProvisionalActiveDevice",
"(",
"m",
"MetaContext",
",",
"uv",
"keybase1",
".",
"UserVersion",
",",
"d",
"keybase1",
".",
"DeviceID",
",",
"sigKey",
"GenericKey",
",",
"encKey",
"GenericKey",
",",
"deviceName",
"string",
")",
"*",
"ActiveDevice",
"{",... | // NewProvisionalActiveDevice creates an ActiveDevice that is "provisional", in
// that it should not be considered the global ActiveDevice. Instead, it should
// reside in thread-local context, and can be weaved through the login
// machinery without trampling the actual global ActiveDevice. | [
"NewProvisionalActiveDevice",
"creates",
"an",
"ActiveDevice",
"that",
"is",
"provisional",
"in",
"that",
"it",
"should",
"not",
"be",
"considered",
"the",
"global",
"ActiveDevice",
".",
"Instead",
"it",
"should",
"reside",
"in",
"thread",
"-",
"local",
"context",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/active_device.go#L51-L61 |
161,398 | keybase/client | go/libkb/active_device.go | Copy | func (a *ActiveDevice) Copy(m MetaContext, src *ActiveDevice) error {
// Take a consistent snapshot of the src device. Be careful not to hold
// locks on both devices at once.
src.Lock()
uv := src.uv
deviceID := src.deviceID
sigKey := src.signingKey
encKey := src.encryptionKey
name := src.deviceName
ctime := ... | go | func (a *ActiveDevice) Copy(m MetaContext, src *ActiveDevice) error {
// Take a consistent snapshot of the src device. Be careful not to hold
// locks on both devices at once.
src.Lock()
uv := src.uv
deviceID := src.deviceID
sigKey := src.signingKey
encKey := src.encryptionKey
name := src.deviceName
ctime := ... | [
"func",
"(",
"a",
"*",
"ActiveDevice",
")",
"Copy",
"(",
"m",
"MetaContext",
",",
"src",
"*",
"ActiveDevice",
")",
"error",
"{",
"// Take a consistent snapshot of the src device. Be careful not to hold",
"// locks on both devices at once.",
"src",
".",
"Lock",
"(",
")",... | // Copy ActiveDevice info from the given ActiveDevice. | [
"Copy",
"ActiveDevice",
"info",
"from",
"the",
"given",
"ActiveDevice",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/active_device.go#L94-L108 |
161,399 | keybase/client | go/libkb/active_device.go | Set | func (a *ActiveDevice) Set(m MetaContext, uv keybase1.UserVersion, deviceID keybase1.DeviceID,
sigKey, encKey GenericKey, deviceName string, deviceCtime keybase1.Time) error {
a.Lock()
defer a.Unlock()
if err := a.internalUpdateUserVersionDeviceID(uv, deviceID); err != nil {
return err
}
a.signingKey = sigKey... | go | func (a *ActiveDevice) Set(m MetaContext, uv keybase1.UserVersion, deviceID keybase1.DeviceID,
sigKey, encKey GenericKey, deviceName string, deviceCtime keybase1.Time) error {
a.Lock()
defer a.Unlock()
if err := a.internalUpdateUserVersionDeviceID(uv, deviceID); err != nil {
return err
}
a.signingKey = sigKey... | [
"func",
"(",
"a",
"*",
"ActiveDevice",
")",
"Set",
"(",
"m",
"MetaContext",
",",
"uv",
"keybase1",
".",
"UserVersion",
",",
"deviceID",
"keybase1",
".",
"DeviceID",
",",
"sigKey",
",",
"encKey",
"GenericKey",
",",
"deviceName",
"string",
",",
"deviceCtime",
... | // Set acquires the write lock and sets all the fields in ActiveDevice.
// The acct parameter is not used for anything except to help ensure
// that this is called from inside a LoginState account request. | [
"Set",
"acquires",
"the",
"write",
"lock",
"and",
"sets",
"all",
"the",
"fields",
"in",
"ActiveDevice",
".",
"The",
"acct",
"parameter",
"is",
"not",
"used",
"for",
"anything",
"except",
"to",
"help",
"ensure",
"that",
"this",
"is",
"called",
"from",
"insi... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/active_device.go#L122-L139 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.