id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
159,200 | keybase/client | go/engine/login_provision.go | syncedPGPKey | func (e *loginProvision) syncedPGPKey(m libkb.MetaContext) (ret libkb.GenericKey, err error) {
defer m.Trace("loginProvision#syncedPGPKey", func() error { return err })()
key, err := e.arg.User.SyncedSecretKey(m)
if err != nil {
return nil, err
}
if key == nil {
return nil, libkb.NoSyncedPGPKeyError{}
}
m.... | go | func (e *loginProvision) syncedPGPKey(m libkb.MetaContext) (ret libkb.GenericKey, err error) {
defer m.Trace("loginProvision#syncedPGPKey", func() error { return err })()
key, err := e.arg.User.SyncedSecretKey(m)
if err != nil {
return nil, err
}
if key == nil {
return nil, libkb.NoSyncedPGPKeyError{}
}
m.... | [
"func",
"(",
"e",
"*",
"loginProvision",
")",
"syncedPGPKey",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"ret",
"libkb",
".",
"GenericKey",
",",
"err",
"error",
")",
"{",
"defer",
"m",
".",
"Trace",
"(",
"\"",
"\"",
",",
"func",
"(",
")",
"er... | // syncedPGPKey looks for a synced pgp key for e.user. If found,
// it unlocks it. | [
"syncedPGPKey",
"looks",
"for",
"a",
"synced",
"pgp",
"key",
"for",
"e",
".",
"user",
".",
"If",
"found",
"it",
"unlocks",
"it",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provision.go#L605-L628 |
159,201 | keybase/client | go/engine/login_provision.go | gpgPrivateIndex | func (e *loginProvision) gpgPrivateIndex(m libkb.MetaContext) (*libkb.GpgKeyIndex, error) {
cli, err := e.gpgClient(m)
if err != nil {
return nil, err
}
// get an index of all the secret keys
index, _, err := cli.Index(true, "")
if err != nil {
return nil, err
}
return index, nil
} | go | func (e *loginProvision) gpgPrivateIndex(m libkb.MetaContext) (*libkb.GpgKeyIndex, error) {
cli, err := e.gpgClient(m)
if err != nil {
return nil, err
}
// get an index of all the secret keys
index, _, err := cli.Index(true, "")
if err != nil {
return nil, err
}
return index, nil
} | [
"func",
"(",
"e",
"*",
"loginProvision",
")",
"gpgPrivateIndex",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"*",
"libkb",
".",
"GpgKeyIndex",
",",
"error",
")",
"{",
"cli",
",",
"err",
":=",
"e",
".",
"gpgClient",
"(",
"m",
")",
"\n",
"if",
"... | // gpgPrivateIndex returns an index of the private gpg keys. | [
"gpgPrivateIndex",
"returns",
"an",
"index",
"of",
"the",
"private",
"gpg",
"keys",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provision.go#L631-L644 |
159,202 | keybase/client | go/engine/login_provision.go | gpgClient | func (e *loginProvision) gpgClient(m libkb.MetaContext) (gpgInterface, error) {
if e.arg.DeviceType == libkb.DeviceTypeMobile {
return nil, libkb.GPGUnavailableError{}
}
if e.gpgCli != nil {
return e.gpgCli, nil
}
gpg := m.G().GetGpgClient()
ok, err := gpg.CanExec()
if err != nil {
return nil, err
}
if ... | go | func (e *loginProvision) gpgClient(m libkb.MetaContext) (gpgInterface, error) {
if e.arg.DeviceType == libkb.DeviceTypeMobile {
return nil, libkb.GPGUnavailableError{}
}
if e.gpgCli != nil {
return e.gpgCli, nil
}
gpg := m.G().GetGpgClient()
ok, err := gpg.CanExec()
if err != nil {
return nil, err
}
if ... | [
"func",
"(",
"e",
"*",
"loginProvision",
")",
"gpgClient",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"(",
"gpgInterface",
",",
"error",
")",
"{",
"if",
"e",
".",
"arg",
".",
"DeviceType",
"==",
"libkb",
".",
"DeviceTypeMobile",
"{",
"return",
"nil",
... | // gpgClient returns a gpg client. | [
"gpgClient",
"returns",
"a",
"gpg",
"client",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provision.go#L647-L665 |
159,203 | keybase/client | go/engine/login_provision.go | checkArg | func (e *loginProvision) checkArg() error {
// check we have a good device type:
if e.arg.DeviceType != libkb.DeviceTypeDesktop && e.arg.DeviceType != libkb.DeviceTypeMobile {
return libkb.InvalidArgumentError{Msg: fmt.Sprintf("device type must be %q or %q, not %q", libkb.DeviceTypeDesktop, libkb.DeviceTypeMobile, ... | go | func (e *loginProvision) checkArg() error {
// check we have a good device type:
if e.arg.DeviceType != libkb.DeviceTypeDesktop && e.arg.DeviceType != libkb.DeviceTypeMobile {
return libkb.InvalidArgumentError{Msg: fmt.Sprintf("device type must be %q or %q, not %q", libkb.DeviceTypeDesktop, libkb.DeviceTypeMobile, ... | [
"func",
"(",
"e",
"*",
"loginProvision",
")",
"checkArg",
"(",
")",
"error",
"{",
"// check we have a good device type:",
"if",
"e",
".",
"arg",
".",
"DeviceType",
"!=",
"libkb",
".",
"DeviceTypeDesktop",
"&&",
"e",
".",
"arg",
".",
"DeviceType",
"!=",
"libk... | // checkArg checks loginProvisionArg for sane arguments. | [
"checkArg",
"checks",
"loginProvisionArg",
"for",
"sane",
"arguments",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provision.go#L668-L679 |
159,204 | keybase/client | go/engine/login_provision.go | getPaperKey | func getPaperKey(m libkb.MetaContext, lastErr error, expectedPrefix *string) (keys *libkb.DeviceWithKeys, prefix string, err error) {
passphrase, err := libkb.GetPaperKeyPassphrase(m, m.UIs().SecretUI, "", lastErr, expectedPrefix)
if err != nil {
return nil, "", err
}
return getPaperKeyFromString(m, passphrase)
... | go | func getPaperKey(m libkb.MetaContext, lastErr error, expectedPrefix *string) (keys *libkb.DeviceWithKeys, prefix string, err error) {
passphrase, err := libkb.GetPaperKeyPassphrase(m, m.UIs().SecretUI, "", lastErr, expectedPrefix)
if err != nil {
return nil, "", err
}
return getPaperKeyFromString(m, passphrase)
... | [
"func",
"getPaperKey",
"(",
"m",
"libkb",
".",
"MetaContext",
",",
"lastErr",
"error",
",",
"expectedPrefix",
"*",
"string",
")",
"(",
"keys",
"*",
"libkb",
".",
"DeviceWithKeys",
",",
"prefix",
"string",
",",
"err",
"error",
")",
"{",
"passphrase",
",",
... | // This is used by SaltpackDecrypt as well. | [
"This",
"is",
"used",
"by",
"SaltpackDecrypt",
"as",
"well",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/login_provision.go#L1133-L1140 |
159,205 | keybase/client | go/libkb/login_session.go | NewLoginSessionWithSalt | func NewLoginSessionWithSalt(g *GlobalContext, emailOrUsername string, salt []byte) *LoginSession {
ls := NewLoginSession(g, emailOrUsername)
ls.salt = salt
// XXX are these right? is this just so the salt can be retrieved?
ls.loaded = true
ls.cleared = true
return ls
} | go | func NewLoginSessionWithSalt(g *GlobalContext, emailOrUsername string, salt []byte) *LoginSession {
ls := NewLoginSession(g, emailOrUsername)
ls.salt = salt
// XXX are these right? is this just so the salt can be retrieved?
ls.loaded = true
ls.cleared = true
return ls
} | [
"func",
"NewLoginSessionWithSalt",
"(",
"g",
"*",
"GlobalContext",
",",
"emailOrUsername",
"string",
",",
"salt",
"[",
"]",
"byte",
")",
"*",
"LoginSession",
"{",
"ls",
":=",
"NewLoginSession",
"(",
"g",
",",
"emailOrUsername",
")",
"\n",
"ls",
".",
"salt",
... | // Upon signup, a login session is created with a generated salt. | [
"Upon",
"signup",
"a",
"login",
"session",
"is",
"created",
"with",
"a",
"generated",
"salt",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/login_session.go#L40-L47 |
159,206 | keybase/client | go/libkb/login_session.go | Clear | func (s *LoginSession) Clear() error {
if s == nil {
return nil
}
if !s.loaded {
return ErrLoginSessionNotLoaded
}
s.loginSession = nil
s.loginSessionB64 = ""
s.cleared = true
return nil
} | go | func (s *LoginSession) Clear() error {
if s == nil {
return nil
}
if !s.loaded {
return ErrLoginSessionNotLoaded
}
s.loginSession = nil
s.loginSessionB64 = ""
s.cleared = true
return nil
} | [
"func",
"(",
"s",
"*",
"LoginSession",
")",
"Clear",
"(",
")",
"error",
"{",
"if",
"s",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"if",
"!",
"s",
".",
"loaded",
"{",
"return",
"ErrLoginSessionNotLoaded",
"\n",
"}",
"\n",
"s",
".",
"loginS... | // Clear removes the loginSession value from s. It does not
// clear the salt. Unclear how this is useful. | [
"Clear",
"removes",
"the",
"loginSession",
"value",
"from",
"s",
".",
"It",
"does",
"not",
"clear",
"the",
"salt",
".",
"Unclear",
"how",
"this",
"is",
"useful",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/login_session.go#L113-L124 |
159,207 | keybase/client | go/stellar/stellargregor/stellargregor.go | autoClaim | func (h *Handler) autoClaim(mctx libkb.MetaContext, cli gregor1.IncomingInterface, category string, item gregor.Item) {
mctx.Debug("%v: %v received", h.Name(), category)
mctx.G().GetStellar().KickAutoClaimRunner(mctx, item.Metadata().MsgID())
} | go | func (h *Handler) autoClaim(mctx libkb.MetaContext, cli gregor1.IncomingInterface, category string, item gregor.Item) {
mctx.Debug("%v: %v received", h.Name(), category)
mctx.G().GetStellar().KickAutoClaimRunner(mctx, item.Metadata().MsgID())
} | [
"func",
"(",
"h",
"*",
"Handler",
")",
"autoClaim",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"cli",
"gregor1",
".",
"IncomingInterface",
",",
"category",
"string",
",",
"item",
"gregor",
".",
"Item",
")",
"{",
"mctx",
".",
"Debug",
"(",
"\"",
"\"... | // The server is telling the client to claim relay payments. | [
"The",
"server",
"is",
"telling",
"the",
"client",
"to",
"claim",
"relay",
"payments",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/stellargregor/stellargregor.go#L69-L72 |
159,208 | keybase/client | go/stellar/stellargregor/stellargregor.go | paymentStatus | func (h *Handler) paymentStatus(mctx libkb.MetaContext, cli gregor1.IncomingInterface, category string, item gregor.Item) {
mctx.Debug("%v: %v received IBM, ignoring it", h.Name(), category)
// We will locally dismiss for now so that each client only plays them once:
if err := h.G().GregorState.LocalDismissItem(mct... | go | func (h *Handler) paymentStatus(mctx libkb.MetaContext, cli gregor1.IncomingInterface, category string, item gregor.Item) {
mctx.Debug("%v: %v received IBM, ignoring it", h.Name(), category)
// We will locally dismiss for now so that each client only plays them once:
if err := h.G().GregorState.LocalDismissItem(mct... | [
"func",
"(",
"h",
"*",
"Handler",
")",
"paymentStatus",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"cli",
"gregor1",
".",
"IncomingInterface",
",",
"category",
"string",
",",
"item",
"gregor",
".",
"Item",
")",
"{",
"mctx",
".",
"Debug",
"(",
"\"",
... | // paymentStatus is an old IBM and shouldn't happen anymore | [
"paymentStatus",
"is",
"an",
"old",
"IBM",
"and",
"shouldn",
"t",
"happen",
"anymore"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/stellargregor/stellargregor.go#L115-L122 |
159,209 | keybase/client | go/kbfs/tlfhandle/const_id_getter.go | GetIDForHandle | func (c ConstIDGetter) GetIDForHandle(_ context.Context, _ *Handle) (
tlf.ID, error) {
return c.ID, nil
} | go | func (c ConstIDGetter) GetIDForHandle(_ context.Context, _ *Handle) (
tlf.ID, error) {
return c.ID, nil
} | [
"func",
"(",
"c",
"ConstIDGetter",
")",
"GetIDForHandle",
"(",
"_",
"context",
".",
"Context",
",",
"_",
"*",
"Handle",
")",
"(",
"tlf",
".",
"ID",
",",
"error",
")",
"{",
"return",
"c",
".",
"ID",
",",
"nil",
"\n",
"}"
] | // GetIDForHandle implements the IDGetter interface for ConstIDGetter. | [
"GetIDForHandle",
"implements",
"the",
"IDGetter",
"interface",
"for",
"ConstIDGetter",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/tlfhandle/const_id_getter.go#L21-L24 |
159,210 | keybase/client | go/engine/pgp_verify.go | NewPGPVerify | func NewPGPVerify(g *libkb.GlobalContext, arg *PGPVerifyArg) *PGPVerify {
return &PGPVerify{
arg: arg,
Contextified: libkb.NewContextified(g),
}
} | go | func NewPGPVerify(g *libkb.GlobalContext, arg *PGPVerifyArg) *PGPVerify {
return &PGPVerify{
arg: arg,
Contextified: libkb.NewContextified(g),
}
} | [
"func",
"NewPGPVerify",
"(",
"g",
"*",
"libkb",
".",
"GlobalContext",
",",
"arg",
"*",
"PGPVerifyArg",
")",
"*",
"PGPVerify",
"{",
"return",
"&",
"PGPVerify",
"{",
"arg",
":",
"arg",
",",
"Contextified",
":",
"libkb",
".",
"NewContextified",
"(",
"g",
")... | // NewPGPVerify creates a PGPVerify engine. | [
"NewPGPVerify",
"creates",
"a",
"PGPVerify",
"engine",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_verify.go#L37-L42 |
159,211 | keybase/client | go/engine/pgp_verify.go | runAttached | func (e *PGPVerify) runAttached(m libkb.MetaContext) error {
arg := &PGPDecryptArg{
Source: e.source,
Sink: libkb.NopWriteCloser{W: ioutil.Discard},
AssertSigned: true,
SignedBy: e.arg.SignedBy,
}
eng := NewPGPDecrypt(m.G(), arg)
if err := RunEngine2(m, eng); err != nil {
return err
}
... | go | func (e *PGPVerify) runAttached(m libkb.MetaContext) error {
arg := &PGPDecryptArg{
Source: e.source,
Sink: libkb.NopWriteCloser{W: ioutil.Discard},
AssertSigned: true,
SignedBy: e.arg.SignedBy,
}
eng := NewPGPDecrypt(m.G(), arg)
if err := RunEngine2(m, eng); err != nil {
return err
}
... | [
"func",
"(",
"e",
"*",
"PGPVerify",
")",
"runAttached",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"error",
"{",
"arg",
":=",
"&",
"PGPDecryptArg",
"{",
"Source",
":",
"e",
".",
"source",
",",
"Sink",
":",
"libkb",
".",
"NopWriteCloser",
"{",
"W",
"... | // runAttached verifies an attached signature | [
"runAttached",
"verifies",
"an",
"attached",
"signature"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_verify.go#L103-L118 |
159,212 | keybase/client | go/engine/pgp_verify.go | runDetached | func (e *PGPVerify) runDetached(m libkb.MetaContext) error {
sk, err := NewScanKeys(m)
if err != nil {
return err
}
checkfn := openpgp.CheckDetachedSignature
if libkb.IsArmored(e.arg.Signature) {
checkfn = openpgp.CheckArmoredDetachedSignature
}
signer, err := checkfn(sk, e.source, bytes.NewReader(e.arg.Sign... | go | func (e *PGPVerify) runDetached(m libkb.MetaContext) error {
sk, err := NewScanKeys(m)
if err != nil {
return err
}
checkfn := openpgp.CheckDetachedSignature
if libkb.IsArmored(e.arg.Signature) {
checkfn = openpgp.CheckArmoredDetachedSignature
}
signer, err := checkfn(sk, e.source, bytes.NewReader(e.arg.Sign... | [
"func",
"(",
"e",
"*",
"PGPVerify",
")",
"runDetached",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"error",
"{",
"sk",
",",
"err",
":=",
"NewScanKeys",
"(",
"m",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n",
"checkfn"... | // runDetached verifies a detached signature | [
"runDetached",
"verifies",
"a",
"detached",
"signature"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_verify.go#L121-L174 |
159,213 | keybase/client | go/engine/pgp_verify.go | runClearsign | func (e *PGPVerify) runClearsign(m libkb.MetaContext) error {
// clearsign decode only works with the whole data slice, not a reader
// so have to read it all here:
msg, err := ioutil.ReadAll(e.source)
if err != nil {
return err
}
b, _ := clearsign.Decode(msg)
if b == nil {
return errors.New("Unable to decod... | go | func (e *PGPVerify) runClearsign(m libkb.MetaContext) error {
// clearsign decode only works with the whole data slice, not a reader
// so have to read it all here:
msg, err := ioutil.ReadAll(e.source)
if err != nil {
return err
}
b, _ := clearsign.Decode(msg)
if b == nil {
return errors.New("Unable to decod... | [
"func",
"(",
"e",
"*",
"PGPVerify",
")",
"runClearsign",
"(",
"m",
"libkb",
".",
"MetaContext",
")",
"error",
"{",
"// clearsign decode only works with the whole data slice, not a reader",
"// so have to read it all here:",
"msg",
",",
"err",
":=",
"ioutil",
".",
"ReadA... | // runClearsign verifies a clearsign signature | [
"runClearsign",
"verifies",
"a",
"clearsign",
"signature"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/engine/pgp_verify.go#L177-L234 |
159,214 | keybase/client | go/client/chat_svc_handler.go | ListV1 | func (c *chatServiceHandler) ListV1(ctx context.Context, opts listOptionsV1) Reply {
var cl ChatList
var rlimits []chat1.RateLimit
var pagination *chat1.Pagination
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
topicType, err := TopicTypeFromStrDefault(opts.TopicType)
if err... | go | func (c *chatServiceHandler) ListV1(ctx context.Context, opts listOptionsV1) Reply {
var cl ChatList
var rlimits []chat1.RateLimit
var pagination *chat1.Pagination
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
topicType, err := TopicTypeFromStrDefault(opts.TopicType)
if err... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"ListV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"listOptionsV1",
")",
"Reply",
"{",
"var",
"cl",
"ChatList",
"\n",
"var",
"rlimits",
"[",
"]",
"chat1",
".",
"RateLimit",
"\n",
"var",
"pagina... | // ListV1 implements ChatServiceHandler.ListV1. | [
"ListV1",
"implements",
"ChatServiceHandler",
".",
"ListV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L122-L193 |
159,215 | keybase/client | go/client/chat_svc_handler.go | ReadV1 | func (c *chatServiceHandler) ReadV1(ctx context.Context, opts readOptionsV1) Reply {
var rlimits []chat1.RateLimit
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
conv, rlimits, err := c.findConversation(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
arg := c... | go | func (c *chatServiceHandler) ReadV1(ctx context.Context, opts readOptionsV1) Reply {
var rlimits []chat1.RateLimit
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
conv, rlimits, err := c.findConversation(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
arg := c... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"ReadV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"readOptionsV1",
")",
"Reply",
"{",
"var",
"rlimits",
"[",
"]",
"chat1",
".",
"RateLimit",
"\n",
"client",
",",
"err",
":=",
"GetChatLocalClient... | // ReadV1 implements ChatServiceHandler.ReadV1. | [
"ReadV1",
"implements",
"ChatServiceHandler",
".",
"ReadV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L363-L417 |
159,216 | keybase/client | go/client/chat_svc_handler.go | GetV1 | func (c *chatServiceHandler) GetV1(ctx context.Context, opts getOptionsV1) Reply {
var rlimits []chat1.RateLimit
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
conv, rlimits, err := c.findConversation(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
arg := cha... | go | func (c *chatServiceHandler) GetV1(ctx context.Context, opts getOptionsV1) Reply {
var rlimits []chat1.RateLimit
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
conv, rlimits, err := c.findConversation(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
arg := cha... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"GetV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"getOptionsV1",
")",
"Reply",
"{",
"var",
"rlimits",
"[",
"]",
"chat1",
".",
"RateLimit",
"\n",
"client",
",",
"err",
":=",
"GetChatLocalClient",... | // GetV1 implements ChatServiceHandler.GetV1. | [
"GetV1",
"implements",
"ChatServiceHandler",
".",
"GetV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L420-L465 |
159,217 | keybase/client | go/client/chat_svc_handler.go | SendV1 | func (c *chatServiceHandler) SendV1(ctx context.Context, opts sendOptionsV1, ui chat1.ChatUiInterface) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithText(chat1.MessageText{Body: opts.Message.Body}),
mtype: chat1.MessageType_TEXT,
response: ... | go | func (c *chatServiceHandler) SendV1(ctx context.Context, opts sendOptionsV1, ui chat1.ChatUiInterface) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithText(chat1.MessageText{Body: opts.Message.Body}),
mtype: chat1.MessageType_TEXT,
response: ... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"SendV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"sendOptionsV1",
",",
"ui",
"chat1",
".",
"ChatUiInterface",
")",
"Reply",
"{",
"arg",
":=",
"sendArgV1",
"{",
"channel",
":",
"opts",
".",
"C... | // SendV1 implements ChatServiceHandler.SendV1. | [
"SendV1",
"implements",
"ChatServiceHandler",
".",
"SendV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L468-L479 |
159,218 | keybase/client | go/client/chat_svc_handler.go | DeleteV1 | func (c *chatServiceHandler) DeleteV1(ctx context.Context, opts deleteOptionsV1) Reply {
messages := []chat1.MessageID{opts.MessageID}
arg := sendArgV1{
channel: opts.Channel,
mtype: chat1.MessageType_DELETE,
supersedes: opts.MessageID,
deletes: messages,
response: "message deleted",
// NOTE... | go | func (c *chatServiceHandler) DeleteV1(ctx context.Context, opts deleteOptionsV1) Reply {
messages := []chat1.MessageID{opts.MessageID}
arg := sendArgV1{
channel: opts.Channel,
mtype: chat1.MessageType_DELETE,
supersedes: opts.MessageID,
deletes: messages,
response: "message deleted",
// NOTE... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"DeleteV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"deleteOptionsV1",
")",
"Reply",
"{",
"messages",
":=",
"[",
"]",
"chat1",
".",
"MessageID",
"{",
"opts",
".",
"MessageID",
"}",
"\n",
"arg"... | // DeleteV1 implements ChatServiceHandler.DeleteV1. | [
"DeleteV1",
"implements",
"ChatServiceHandler",
".",
"DeleteV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L482-L495 |
159,219 | keybase/client | go/client/chat_svc_handler.go | EditV1 | func (c *chatServiceHandler) EditV1(ctx context.Context, opts editOptionsV1) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithEdit(chat1.MessageEdit{MessageID: opts.MessageID, Body: opts.Message.Body}),
mtype: chat1.MessageType_EDIT,
supersedes: opts.MessageID,
re... | go | func (c *chatServiceHandler) EditV1(ctx context.Context, opts editOptionsV1) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithEdit(chat1.MessageEdit{MessageID: opts.MessageID, Body: opts.Message.Body}),
mtype: chat1.MessageType_EDIT,
supersedes: opts.MessageID,
re... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"EditV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"editOptionsV1",
")",
"Reply",
"{",
"arg",
":=",
"sendArgV1",
"{",
"channel",
":",
"opts",
".",
"Channel",
",",
"body",
":",
"chat1",
".",
"... | // EditV1 implements ChatServiceHandler.EditV1. | [
"EditV1",
"implements",
"ChatServiceHandler",
".",
"EditV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L498-L508 |
159,220 | keybase/client | go/client/chat_svc_handler.go | ReactionV1 | func (c *chatServiceHandler) ReactionV1(ctx context.Context, opts reactionOptionsV1) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithReaction(chat1.MessageReaction{MessageID: opts.MessageID, Body: opts.Message.Body}),
mtype: chat1.MessageType_REACTION,
supersedes: o... | go | func (c *chatServiceHandler) ReactionV1(ctx context.Context, opts reactionOptionsV1) Reply {
arg := sendArgV1{
channel: opts.Channel,
body: chat1.NewMessageBodyWithReaction(chat1.MessageReaction{MessageID: opts.MessageID, Body: opts.Message.Body}),
mtype: chat1.MessageType_REACTION,
supersedes: o... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"ReactionV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"reactionOptionsV1",
")",
"Reply",
"{",
"arg",
":=",
"sendArgV1",
"{",
"channel",
":",
"opts",
".",
"Channel",
",",
"body",
":",
"chat1",
... | // ReactionV1 implements ChatServiceHandler.ReactionV1. | [
"ReactionV1",
"implements",
"ChatServiceHandler",
".",
"ReactionV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L511-L520 |
159,221 | keybase/client | go/client/chat_svc_handler.go | DownloadV1 | func (c *chatServiceHandler) DownloadV1(ctx context.Context, opts downloadOptionsV1,
chatUI chat1.ChatUiInterface) Reply {
if opts.NoStream && opts.Output != "-" {
return c.downloadV1NoStream(ctx, opts, chatUI)
}
var fsink Sink
if opts.Output == "-" {
fsink = &StdoutSink{}
} else {
fsink = NewFileSink(c.G()... | go | func (c *chatServiceHandler) DownloadV1(ctx context.Context, opts downloadOptionsV1,
chatUI chat1.ChatUiInterface) Reply {
if opts.NoStream && opts.Output != "-" {
return c.downloadV1NoStream(ctx, opts, chatUI)
}
var fsink Sink
if opts.Output == "-" {
fsink = &StdoutSink{}
} else {
fsink = NewFileSink(c.G()... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"DownloadV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"downloadOptionsV1",
",",
"chatUI",
"chat1",
".",
"ChatUiInterface",
")",
"Reply",
"{",
"if",
"opts",
".",
"NoStream",
"&&",
"opts",
".",
"O... | // DownloadV1 implements ChatServiceHandler.DownloadV1. | [
"DownloadV1",
"implements",
"ChatServiceHandler",
".",
"DownloadV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L611-L670 |
159,222 | keybase/client | go/client/chat_svc_handler.go | downloadV1NoStream | func (c *chatServiceHandler) downloadV1NoStream(ctx context.Context, opts downloadOptionsV1,
chatUI chat1.ChatUiInterface) Reply {
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
protocols := []rpc.Protocol{
NewStreamUIProtocol(c.G()),
chat1.ChatUiProtocol(chatUI),
}
if er... | go | func (c *chatServiceHandler) downloadV1NoStream(ctx context.Context, opts downloadOptionsV1,
chatUI chat1.ChatUiInterface) Reply {
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
protocols := []rpc.Protocol{
NewStreamUIProtocol(c.G()),
chat1.ChatUiProtocol(chatUI),
}
if er... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"downloadV1NoStream",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"downloadOptionsV1",
",",
"chatUI",
"chat1",
".",
"ChatUiInterface",
")",
"Reply",
"{",
"client",
",",
"err",
":=",
"GetChatLocalClient",
... | // downloadV1NoStream uses DownloadFileAttachmentLocal instead of DownloadAttachmentLocal. | [
"downloadV1NoStream",
"uses",
"DownloadFileAttachmentLocal",
"instead",
"of",
"DownloadAttachmentLocal",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L673-L713 |
159,223 | keybase/client | go/client/chat_svc_handler.go | SetStatusV1 | func (c *chatServiceHandler) SetStatusV1(ctx context.Context, opts setStatusOptionsV1) Reply {
var rlimits []chat1.RateLimit
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
status, ok := chat1.ConversationStatusMap[strings.ToUpper(opts.Status)]
if !ok {
... | go | func (c *chatServiceHandler) SetStatusV1(ctx context.Context, opts setStatusOptionsV1) Reply {
var rlimits []chat1.RateLimit
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
status, ok := chat1.ConversationStatusMap[strings.ToUpper(opts.Status)]
if !ok {
... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"SetStatusV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"setStatusOptionsV1",
")",
"Reply",
"{",
"var",
"rlimits",
"[",
"]",
"chat1",
".",
"RateLimit",
"\n\n",
"convID",
",",
"rlimits",
",",
"err... | // SetStatusV1 implements ChatServiceHandler.SetStatusV1. | [
"SetStatusV1",
"implements",
"ChatServiceHandler",
".",
"SetStatusV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L716-L750 |
159,224 | keybase/client | go/client/chat_svc_handler.go | MarkV1 | func (c *chatServiceHandler) MarkV1(ctx context.Context, opts markOptionsV1) Reply {
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
arg := chat1.MarkAsReadLocalArg{
Co... | go | func (c *chatServiceHandler) MarkV1(ctx context.Context, opts markOptionsV1) Reply {
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
arg := chat1.MarkAsReadLocalArg{
Co... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"MarkV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"markOptionsV1",
")",
"Reply",
"{",
"convID",
",",
"rlimits",
",",
"err",
":=",
"c",
".",
"resolveAPIConvID",
"(",
"ctx",
",",
"opts",
".",
... | // MarkV1 implements ChatServiceHandler.MarkV1. | [
"MarkV1",
"implements",
"ChatServiceHandler",
".",
"MarkV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L753-L781 |
159,225 | keybase/client | go/client/chat_svc_handler.go | SearchInboxV1 | func (c *chatServiceHandler) SearchInboxV1(ctx context.Context, opts searchInboxOptionsV1) Reply {
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
if opts.MaxHits <= 0 {
opts.MaxHits = 10
}
reindexMode := chat1.ReIndexingMode_NONE
if opts.ForceReindex {
reindexMode = cha... | go | func (c *chatServiceHandler) SearchInboxV1(ctx context.Context, opts searchInboxOptionsV1) Reply {
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
if opts.MaxHits <= 0 {
opts.MaxHits = 10
}
reindexMode := chat1.ReIndexingMode_NONE
if opts.ForceReindex {
reindexMode = cha... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"SearchInboxV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"searchInboxOptionsV1",
")",
"Reply",
"{",
"client",
",",
"err",
":=",
"GetChatLocalClient",
"(",
"c",
".",
"G",
"(",
")",
")",
"\n",
"... | // SearchInbox implements ChatServiceHandler.SearchInboxV1. | [
"SearchInbox",
"implements",
"ChatServiceHandler",
".",
"SearchInboxV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L784-L844 |
159,226 | keybase/client | go/client/chat_svc_handler.go | SearchRegexpV1 | func (c *chatServiceHandler) SearchRegexpV1(ctx context.Context, opts searchRegexpOptionsV1) Reply {
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
if opts.MaxHits <= 0 ... | go | func (c *chatServiceHandler) SearchRegexpV1(ctx context.Context, opts searchRegexpOptionsV1) Reply {
convID, rlimits, err := c.resolveAPIConvID(ctx, opts.Channel)
if err != nil {
return c.errReply(err)
}
client, err := GetChatLocalClient(c.G())
if err != nil {
return c.errReply(err)
}
if opts.MaxHits <= 0 ... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"SearchRegexpV1",
"(",
"ctx",
"context",
".",
"Context",
",",
"opts",
"searchRegexpOptionsV1",
")",
"Reply",
"{",
"convID",
",",
"rlimits",
",",
"err",
":=",
"c",
".",
"resolveAPIConvID",
"(",
"ctx",
",",
"... | // SearchRegexpV1 implements ChatServiceHandler.SearchRegexpV1. | [
"SearchRegexpV1",
"implements",
"ChatServiceHandler",
".",
"SearchRegexpV1",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L847-L915 |
159,227 | keybase/client | go/client/chat_svc_handler.go | convertMsgBody | func (c *chatServiceHandler) convertMsgBody(mb chat1.MessageBody) MsgContent {
return MsgContent{
TypeName: strings.ToLower(chat1.MessageTypeRevMap[mb.MessageType__]),
Text: mb.Text__,
Attachment: mb.Attachment__,
Edit: mb.Edit__,
Reaction: mb.Reaction_... | go | func (c *chatServiceHandler) convertMsgBody(mb chat1.MessageBody) MsgContent {
return MsgContent{
TypeName: strings.ToLower(chat1.MessageTypeRevMap[mb.MessageType__]),
Text: mb.Text__,
Attachment: mb.Attachment__,
Edit: mb.Edit__,
Reaction: mb.Reaction_... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"convertMsgBody",
"(",
"mb",
"chat1",
".",
"MessageBody",
")",
"MsgContent",
"{",
"return",
"MsgContent",
"{",
"TypeName",
":",
"strings",
".",
"ToLower",
"(",
"chat1",
".",
"MessageTypeRevMap",
"[",
"mb",
".... | // need this to get message type name | [
"need",
"this",
"to",
"get",
"message",
"type",
"name"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L1147-L1164 |
159,228 | keybase/client | go/client/chat_svc_handler.go | resolveAPIConvID | func (c *chatServiceHandler) resolveAPIConvID(ctx context.Context, channel ChatChannel) (chat1.ConversationID, []chat1.RateLimit, error) {
conv, limits, err := c.findConversation(ctx, channel)
if err != nil {
return chat1.ConversationID{}, nil, err
}
return conv.Info.Id, limits, nil
} | go | func (c *chatServiceHandler) resolveAPIConvID(ctx context.Context, channel ChatChannel) (chat1.ConversationID, []chat1.RateLimit, error) {
conv, limits, err := c.findConversation(ctx, channel)
if err != nil {
return chat1.ConversationID{}, nil, err
}
return conv.Info.Id, limits, nil
} | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"resolveAPIConvID",
"(",
"ctx",
"context",
".",
"Context",
",",
"channel",
"ChatChannel",
")",
"(",
"chat1",
".",
"ConversationID",
",",
"[",
"]",
"chat1",
".",
"RateLimit",
",",
"error",
")",
"{",
"conv",
... | // Resolve the ConvID of the specified conversation.
// Uses tlfclient and GetInboxAndUnboxLocal's ConversationsUnverified. | [
"Resolve",
"the",
"ConvID",
"of",
"the",
"specified",
"conversation",
".",
"Uses",
"tlfclient",
"and",
"GetInboxAndUnboxLocal",
"s",
"ConversationsUnverified",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L1208-L1214 |
159,229 | keybase/client | go/client/chat_svc_handler.go | findConversation | func (c *chatServiceHandler) findConversation(ctx context.Context, channel ChatChannel) (chat1.ConversationLocal, []chat1.RateLimit, error) {
var conv chat1.ConversationLocal
var rlimits []chat1.RateLimit
if channel.IsNil() {
return conv, rlimits, errors.New("missing conversation specificer")
}
existing, exist... | go | func (c *chatServiceHandler) findConversation(ctx context.Context, channel ChatChannel) (chat1.ConversationLocal, []chat1.RateLimit, error) {
var conv chat1.ConversationLocal
var rlimits []chat1.RateLimit
if channel.IsNil() {
return conv, rlimits, errors.New("missing conversation specificer")
}
existing, exist... | [
"func",
"(",
"c",
"*",
"chatServiceHandler",
")",
"findConversation",
"(",
"ctx",
"context",
".",
"Context",
",",
"channel",
"ChatChannel",
")",
"(",
"chat1",
".",
"ConversationLocal",
",",
"[",
"]",
"chat1",
".",
"RateLimit",
",",
"error",
")",
"{",
"var"... | // findConversation finds a conversation.
// Uses tlfclient and GetInboxAndUnboxLocal's ConversationsUnverified. | [
"findConversation",
"finds",
"a",
"conversation",
".",
"Uses",
"tlfclient",
"and",
"GetInboxAndUnboxLocal",
"s",
"ConversationsUnverified",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/chat_svc_handler.go#L1218-L1240 |
159,230 | keybase/client | go/kbfs/libcontext/delayed_cancellation.go | NewContextWithReplayFrom | func NewContextWithReplayFrom(ctx context.Context) (context.Context, error) {
if replays, ok := ctx.Value(CtxReplayKey).([]CtxReplayFunc); ok {
newCtx := context.Background()
for _, replay := range replays {
newCtx = replay(newCtx)
}
replays, _ := ctx.Value(CtxReplayKey).([]CtxReplayFunc)
newCtx = context... | go | func NewContextWithReplayFrom(ctx context.Context) (context.Context, error) {
if replays, ok := ctx.Value(CtxReplayKey).([]CtxReplayFunc); ok {
newCtx := context.Background()
for _, replay := range replays {
newCtx = replay(newCtx)
}
replays, _ := ctx.Value(CtxReplayKey).([]CtxReplayFunc)
newCtx = context... | [
"func",
"NewContextWithReplayFrom",
"(",
"ctx",
"context",
".",
"Context",
")",
"(",
"context",
".",
"Context",
",",
"error",
")",
"{",
"if",
"replays",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"CtxReplayKey",
")",
".",
"(",
"[",
"]",
"CtxReplayFunc",
... | // NewContextWithReplayFrom constructs a new context out of ctx by calling all
// attached replay functions. This disconnects any existing context.CancelFunc. | [
"NewContextWithReplayFrom",
"constructs",
"a",
"new",
"context",
"out",
"of",
"ctx",
"by",
"calling",
"all",
"attached",
"replay",
"functions",
".",
"This",
"disconnects",
"any",
"existing",
"context",
".",
"CancelFunc",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libcontext/delayed_cancellation.go#L116-L127 |
159,231 | keybase/client | go/kbfs/libcontext/delayed_cancellation.go | BackgroundContextWithCancellationDelayer | func BackgroundContextWithCancellationDelayer() context.Context {
if ctx, err := NewContextWithCancellationDelayer(NewContextReplayable(
context.Background(), func(c context.Context) context.Context {
return c
})); err != nil {
panic(err)
} else {
return ctx
}
} | go | func BackgroundContextWithCancellationDelayer() context.Context {
if ctx, err := NewContextWithCancellationDelayer(NewContextReplayable(
context.Background(), func(c context.Context) context.Context {
return c
})); err != nil {
panic(err)
} else {
return ctx
}
} | [
"func",
"BackgroundContextWithCancellationDelayer",
"(",
")",
"context",
".",
"Context",
"{",
"if",
"ctx",
",",
"err",
":=",
"NewContextWithCancellationDelayer",
"(",
"NewContextReplayable",
"(",
"context",
".",
"Background",
"(",
")",
",",
"func",
"(",
"c",
"cont... | // BackgroundContextWithCancellationDelayer generate a "Background"
// context that is cancellation delayable | [
"BackgroundContextWithCancellationDelayer",
"generate",
"a",
"Background",
"context",
"that",
"is",
"cancellation",
"delayable"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libcontext/delayed_cancellation.go#L237-L246 |
159,232 | keybase/client | go/client/cmd_simplefs_sync_disable.go | NewCmdSimpleFSSyncDisable | func NewCmdSimpleFSSyncDisable(
cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "disable",
ArgumentHelp: "[path-to-folder]",
Usage: "Stops syncing the given folder to local storage",
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdSimpleFSSyncD... | go | func NewCmdSimpleFSSyncDisable(
cl *libcmdline.CommandLine, g *libkb.GlobalContext) cli.Command {
return cli.Command{
Name: "disable",
ArgumentHelp: "[path-to-folder]",
Usage: "Stops syncing the given folder to local storage",
Action: func(c *cli.Context) {
cl.ChooseCommand(&CmdSimpleFSSyncD... | [
"func",
"NewCmdSimpleFSSyncDisable",
"(",
"cl",
"*",
"libcmdline",
".",
"CommandLine",
",",
"g",
"*",
"libkb",
".",
"GlobalContext",
")",
"cli",
".",
"Command",
"{",
"return",
"cli",
".",
"Command",
"{",
"Name",
":",
"\"",
"\"",
",",
"ArgumentHelp",
":",
... | // NewCmdSimpleFSSyncDisable creates a new cli.Command. | [
"NewCmdSimpleFSSyncDisable",
"creates",
"a",
"new",
"cli",
".",
"Command",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/client/cmd_simplefs_sync_disable.go#L24-L36 |
159,233 | keybase/client | go/libkb/util_windows.go | SafeWriteToFile | func SafeWriteToFile(g SafeWriteLogger, t SafeWriter, mode os.FileMode) error {
var err error
for i := 0; i < 5; i++ {
if err != nil {
g.Debug("Retrying failed safeWriteToFileOnce - %s", err)
time.Sleep(10 * time.Millisecond)
}
err = safeWriteToFileOnce(g, t, mode)
if err == nil {
break
}
}
retu... | go | func SafeWriteToFile(g SafeWriteLogger, t SafeWriter, mode os.FileMode) error {
var err error
for i := 0; i < 5; i++ {
if err != nil {
g.Debug("Retrying failed safeWriteToFileOnce - %s", err)
time.Sleep(10 * time.Millisecond)
}
err = safeWriteToFileOnce(g, t, mode)
if err == nil {
break
}
}
retu... | [
"func",
"SafeWriteToFile",
"(",
"g",
"SafeWriteLogger",
",",
"t",
"SafeWriter",
",",
"mode",
"os",
".",
"FileMode",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"5",
";",
"i",
"++",
"{",
"if",
"err",
"!=",
... | // SafeWriteToFile retries safeWriteToFileOnce a few times on Windows,
// in case AV programs interfere with 2 writes in quick succession. | [
"SafeWriteToFile",
"retries",
"safeWriteToFileOnce",
"a",
"few",
"times",
"on",
"Windows",
"in",
"case",
"AV",
"programs",
"interfere",
"with",
"2",
"writes",
"in",
"quick",
"succession",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/util_windows.go#L133-L147 |
159,234 | keybase/client | go/libkb/util_windows.go | renameFile | func renameFile(g *GlobalContext, src string, dest string) error {
var err error
for i := 0; i < 5; i++ {
if err != nil {
g.Log.Debug("Retrying failed os.Rename - %s", err)
time.Sleep(10 * time.Millisecond)
}
err = os.Rename(src, dest)
if err == nil {
break
}
}
return err
} | go | func renameFile(g *GlobalContext, src string, dest string) error {
var err error
for i := 0; i < 5; i++ {
if err != nil {
g.Log.Debug("Retrying failed os.Rename - %s", err)
time.Sleep(10 * time.Millisecond)
}
err = os.Rename(src, dest)
if err == nil {
break
}
}
return err
} | [
"func",
"renameFile",
"(",
"g",
"*",
"GlobalContext",
",",
"src",
"string",
",",
"dest",
"string",
")",
"error",
"{",
"var",
"err",
"error",
"\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"5",
";",
"i",
"++",
"{",
"if",
"err",
"!=",
"nil",
"{",
"g... | // renameFile performs some retries on Windows,
// similar to SafeWriteToFile | [
"renameFile",
"performs",
"some",
"retries",
"on",
"Windows",
"similar",
"to",
"SafeWriteToFile"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/util_windows.go#L151-L164 |
159,235 | keybase/client | go/libkb/util_windows.go | notifyShell | func notifyShell(path string) {
pathEncoded := utf16.Encode([]rune(path))
if len(pathEncoded) > 0 {
shChangeNotifyProc.Call(
uintptr(0x00002000), // SHCNE_UPDATEITEM
uintptr(0x0005), // SHCNF_PATHW
uintptr(unsafe.Pointer(&pathEncoded[0])),
0)
}
} | go | func notifyShell(path string) {
pathEncoded := utf16.Encode([]rune(path))
if len(pathEncoded) > 0 {
shChangeNotifyProc.Call(
uintptr(0x00002000), // SHCNE_UPDATEITEM
uintptr(0x0005), // SHCNF_PATHW
uintptr(unsafe.Pointer(&pathEncoded[0])),
0)
}
} | [
"func",
"notifyShell",
"(",
"path",
"string",
")",
"{",
"pathEncoded",
":=",
"utf16",
".",
"Encode",
"(",
"[",
"]",
"rune",
"(",
"path",
")",
")",
"\n",
"if",
"len",
"(",
"pathEncoded",
")",
">",
"0",
"{",
"shChangeNotifyProc",
".",
"Call",
"(",
"uin... | // Notify the shell that the thing located at path has changed | [
"Notify",
"the",
"shell",
"that",
"the",
"thing",
"located",
"at",
"path",
"has",
"changed"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/util_windows.go#L189-L198 |
159,236 | keybase/client | go/libkb/util_windows.go | ChangeMountIcon | func ChangeMountIcon(oldMount string, newMount string) error {
if oldMount != "" {
// DeleteKey doesn't work if there are subkeys
registry.DeleteKey(registry.CURRENT_USER, `SOFTWARE\Classes\Applications\Explorer.exe\Drives\`+oldMount[:1]+`\DefaultIcon`)
registry.DeleteKey(registry.CURRENT_USER, `SOFTWARE\Classes... | go | func ChangeMountIcon(oldMount string, newMount string) error {
if oldMount != "" {
// DeleteKey doesn't work if there are subkeys
registry.DeleteKey(registry.CURRENT_USER, `SOFTWARE\Classes\Applications\Explorer.exe\Drives\`+oldMount[:1]+`\DefaultIcon`)
registry.DeleteKey(registry.CURRENT_USER, `SOFTWARE\Classes... | [
"func",
"ChangeMountIcon",
"(",
"oldMount",
"string",
",",
"newMount",
"string",
")",
"error",
"{",
"if",
"oldMount",
"!=",
"\"",
"\"",
"{",
"// DeleteKey doesn't work if there are subkeys",
"registry",
".",
"DeleteKey",
"(",
"registry",
".",
"CURRENT_USER",
",",
... | // Manipulate registry entries to reflect the mount point icon in the shell | [
"Manipulate",
"registry",
"entries",
"to",
"reflect",
"the",
"mount",
"point",
"icon",
"in",
"the",
"shell"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/util_windows.go#L201-L233 |
159,237 | keybase/client | go/kbfs/libfuse/folderlist.go | PathType | func (fl *FolderList) PathType() tlfhandle.PathType {
switch fl.tlfType {
case tlf.Private:
return tlfhandle.PrivatePathType
case tlf.Public:
return tlfhandle.PublicPathType
case tlf.SingleTeam:
return tlfhandle.SingleTeamPathType
default:
panic(fmt.Sprintf("Unsupported tlf type: %s", fl.tlfType))
}
} | go | func (fl *FolderList) PathType() tlfhandle.PathType {
switch fl.tlfType {
case tlf.Private:
return tlfhandle.PrivatePathType
case tlf.Public:
return tlfhandle.PublicPathType
case tlf.SingleTeam:
return tlfhandle.SingleTeamPathType
default:
panic(fmt.Sprintf("Unsupported tlf type: %s", fl.tlfType))
}
} | [
"func",
"(",
"fl",
"*",
"FolderList",
")",
"PathType",
"(",
")",
"tlfhandle",
".",
"PathType",
"{",
"switch",
"fl",
".",
"tlfType",
"{",
"case",
"tlf",
".",
"Private",
":",
"return",
"tlfhandle",
".",
"PrivatePathType",
"\n",
"case",
"tlf",
".",
"Public"... | // PathType returns PathType for this folder | [
"PathType",
"returns",
"PathType",
"for",
"this",
"folder"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/folderlist.go#L137-L148 |
159,238 | keybase/client | go/kbfs/libfuse/folderlist.go | Create | func (fl *FolderList) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (_ fs.Node, _ fs.Handle, err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FL Create")
tlfName := tlf.CanonicalName(req.Name)
defer func() { err = fl.processError(ctx, libkbfs.WriteMode, tlfName, err) }()
if strings... | go | func (fl *FolderList) Create(ctx context.Context, req *fuse.CreateRequest, resp *fuse.CreateResponse) (_ fs.Node, _ fs.Handle, err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FL Create")
tlfName := tlf.CanonicalName(req.Name)
defer func() { err = fl.processError(ctx, libkbfs.WriteMode, tlfName, err) }()
if strings... | [
"func",
"(",
"fl",
"*",
"FolderList",
")",
"Create",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"CreateRequest",
",",
"resp",
"*",
"fuse",
".",
"CreateResponse",
")",
"(",
"_",
"fs",
".",
"Node",
",",
"_",
"fs",
".",
"Hand... | // Create implements the fs.NodeCreater interface for FolderList. | [
"Create",
"implements",
"the",
"fs",
".",
"NodeCreater",
"interface",
"for",
"FolderList",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/folderlist.go#L151-L161 |
159,239 | keybase/client | go/kbfs/libfuse/folderlist.go | Mkdir | func (fl *FolderList) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (_ fs.Node, err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FL Mkdir")
tlfName := tlf.CanonicalName(req.Name)
defer func() { err = fl.processError(ctx, libkbfs.WriteMode, tlfName, err) }()
return nil, libkbfs.NewWriteUnsupportedError(tlfhandl... | go | func (fl *FolderList) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (_ fs.Node, err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FL Mkdir")
tlfName := tlf.CanonicalName(req.Name)
defer func() { err = fl.processError(ctx, libkbfs.WriteMode, tlfName, err) }()
return nil, libkbfs.NewWriteUnsupportedError(tlfhandl... | [
"func",
"(",
"fl",
"*",
"FolderList",
")",
"Mkdir",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"MkdirRequest",
")",
"(",
"_",
"fs",
".",
"Node",
",",
"err",
"error",
")",
"{",
"fl",
".",
"fs",
".",
"vlog",
".",
"CLogf",
... | // Mkdir implements the fs.NodeMkdirer interface for FolderList. | [
"Mkdir",
"implements",
"the",
"fs",
".",
"NodeMkdirer",
"interface",
"for",
"FolderList",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/folderlist.go#L164-L169 |
159,240 | keybase/client | go/kbfs/libfuse/folderlist.go | Remove | func (fl *FolderList) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FolderList Remove %s", req.Name)
defer func() { err = fl.fs.processError(ctx, libkbfs.WriteMode, err) }()
h, err := tlfhandle.ParseHandlePreferredQuick(
ctx, fl.fs.config.KBPKI(), fl.fs.con... | go | func (fl *FolderList) Remove(ctx context.Context, req *fuse.RemoveRequest) (err error) {
fl.fs.vlog.CLogf(ctx, libkb.VLog1, "FolderList Remove %s", req.Name)
defer func() { err = fl.fs.processError(ctx, libkbfs.WriteMode, err) }()
h, err := tlfhandle.ParseHandlePreferredQuick(
ctx, fl.fs.config.KBPKI(), fl.fs.con... | [
"func",
"(",
"fl",
"*",
"FolderList",
")",
"Remove",
"(",
"ctx",
"context",
".",
"Context",
",",
"req",
"*",
"fuse",
".",
"RemoveRequest",
")",
"(",
"err",
"error",
")",
"{",
"fl",
".",
"fs",
".",
"vlog",
".",
"CLogf",
"(",
"ctx",
",",
"libkb",
"... | // Remove implements the fs.NodeRemover interface for FolderList. | [
"Remove",
"implements",
"the",
"fs",
".",
"NodeRemover",
"interface",
"for",
"FolderList",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfuse/folderlist.go#L287-L320 |
159,241 | keybase/client | go/kbfs/libgit/autogit_manager.go | NewAutogitManager | func NewAutogitManager(
config libkbfs.Config, browserCacheSize int) *AutogitManager {
log := config.MakeLogger("")
browserCache, err := lru.New(browserCacheSize)
if err != nil {
panic(err.Error())
}
sharedCache, err := newLRUSharedInBrowserCache()
if err != nil {
panic(err.Error())
}
return &AutogitManag... | go | func NewAutogitManager(
config libkbfs.Config, browserCacheSize int) *AutogitManager {
log := config.MakeLogger("")
browserCache, err := lru.New(browserCacheSize)
if err != nil {
panic(err.Error())
}
sharedCache, err := newLRUSharedInBrowserCache()
if err != nil {
panic(err.Error())
}
return &AutogitManag... | [
"func",
"NewAutogitManager",
"(",
"config",
"libkbfs",
".",
"Config",
",",
"browserCacheSize",
"int",
")",
"*",
"AutogitManager",
"{",
"log",
":=",
"config",
".",
"MakeLogger",
"(",
"\"",
"\"",
")",
"\n",
"browserCache",
",",
"err",
":=",
"lru",
".",
"New"... | // NewAutogitManager constructs a new AutogitManager instance. | [
"NewAutogitManager",
"constructs",
"a",
"new",
"AutogitManager",
"instance",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L76-L98 |
159,242 | keybase/client | go/kbfs/libgit/autogit_manager.go | Shutdown | func (am *AutogitManager) Shutdown() {
am.registryLock.Lock()
defer am.registryLock.Unlock()
am.shutdown = true
for _, cancel := range am.deleteCancels {
cancel()
}
} | go | func (am *AutogitManager) Shutdown() {
am.registryLock.Lock()
defer am.registryLock.Unlock()
am.shutdown = true
for _, cancel := range am.deleteCancels {
cancel()
}
} | [
"func",
"(",
"am",
"*",
"AutogitManager",
")",
"Shutdown",
"(",
")",
"{",
"am",
".",
"registryLock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"am",
".",
"registryLock",
".",
"Unlock",
"(",
")",
"\n",
"am",
".",
"shutdown",
"=",
"true",
"\n",
"for",
"_... | // Shutdown shuts down this manager. | [
"Shutdown",
"shuts",
"down",
"this",
"manager",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L101-L108 |
159,243 | keybase/client | go/kbfs/libgit/autogit_manager.go | LocalChange | func (am *AutogitManager) LocalChange(
ctx context.Context, node libkbfs.Node, wr libkbfs.WriteRange) {
// Do nothing.
} | go | func (am *AutogitManager) LocalChange(
ctx context.Context, node libkbfs.Node, wr libkbfs.WriteRange) {
// Do nothing.
} | [
"func",
"(",
"am",
"*",
"AutogitManager",
")",
"LocalChange",
"(",
"ctx",
"context",
".",
"Context",
",",
"node",
"libkbfs",
".",
"Node",
",",
"wr",
"libkbfs",
".",
"WriteRange",
")",
"{",
"// Do nothing.",
"}"
] | // LocalChange implements the libkbfs.Observer interface for AutogitManager. | [
"LocalChange",
"implements",
"the",
"libkbfs",
".",
"Observer",
"interface",
"for",
"AutogitManager",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L223-L226 |
159,244 | keybase/client | go/kbfs/libgit/autogit_manager.go | BatchChanges | func (am *AutogitManager) BatchChanges(
ctx context.Context, _ []libkbfs.NodeChange,
affectedNodeIDs []libkbfs.NodeID) {
nodes, repoNodeIDs := am.getNodesToInvalidate(affectedNodeIDs)
go am.clearInvalidatedBrowsers(repoNodeIDs)
for _, node := range nodes {
node := node
go func() {
ctx := libkbfs.CtxWithRand... | go | func (am *AutogitManager) BatchChanges(
ctx context.Context, _ []libkbfs.NodeChange,
affectedNodeIDs []libkbfs.NodeID) {
nodes, repoNodeIDs := am.getNodesToInvalidate(affectedNodeIDs)
go am.clearInvalidatedBrowsers(repoNodeIDs)
for _, node := range nodes {
node := node
go func() {
ctx := libkbfs.CtxWithRand... | [
"func",
"(",
"am",
"*",
"AutogitManager",
")",
"BatchChanges",
"(",
"ctx",
"context",
".",
"Context",
",",
"_",
"[",
"]",
"libkbfs",
".",
"NodeChange",
",",
"affectedNodeIDs",
"[",
"]",
"libkbfs",
".",
"NodeID",
")",
"{",
"nodes",
",",
"repoNodeIDs",
":=... | // BatchChanges implements the libkbfs.Observer interface for AutogitManager. | [
"BatchChanges",
"implements",
"the",
"libkbfs",
".",
"Observer",
"interface",
"for",
"AutogitManager",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L276-L289 |
159,245 | keybase/client | go/kbfs/libgit/autogit_manager.go | GetBrowserForRepo | func (am *AutogitManager) GetBrowserForRepo(
ctx context.Context, gitFS *libfs.FS, repoName string,
branch plumbing.ReferenceName, subdir string) (*libfs.FS, *Browser, error) {
am.browserLock.Lock()
defer am.browserLock.Unlock()
return am.getBrowserForRepoLocked(ctx, gitFS, repoName, branch, subdir)
} | go | func (am *AutogitManager) GetBrowserForRepo(
ctx context.Context, gitFS *libfs.FS, repoName string,
branch plumbing.ReferenceName, subdir string) (*libfs.FS, *Browser, error) {
am.browserLock.Lock()
defer am.browserLock.Unlock()
return am.getBrowserForRepoLocked(ctx, gitFS, repoName, branch, subdir)
} | [
"func",
"(",
"am",
"*",
"AutogitManager",
")",
"GetBrowserForRepo",
"(",
"ctx",
"context",
".",
"Context",
",",
"gitFS",
"*",
"libfs",
".",
"FS",
",",
"repoName",
"string",
",",
"branch",
"plumbing",
".",
"ReferenceName",
",",
"subdir",
"string",
")",
"(",... | // GetBrowserForRepo returns the root FS for the specified repo and a
// `Browser` for the branch and subdir. | [
"GetBrowserForRepo",
"returns",
"the",
"root",
"FS",
"for",
"the",
"specified",
"repo",
"and",
"a",
"Browser",
"for",
"the",
"branch",
"and",
"subdir",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L356-L362 |
159,246 | keybase/client | go/kbfs/libgit/autogit_manager.go | StartAutogit | func StartAutogit(config libkbfs.Config, browserCacheSize int) func() {
am := NewAutogitManager(config, browserCacheSize)
rw := rootWrapper{am}
config.AddRootNodeWrapper(rw.wrap)
return am.Shutdown
} | go | func StartAutogit(config libkbfs.Config, browserCacheSize int) func() {
am := NewAutogitManager(config, browserCacheSize)
rw := rootWrapper{am}
config.AddRootNodeWrapper(rw.wrap)
return am.Shutdown
} | [
"func",
"StartAutogit",
"(",
"config",
"libkbfs",
".",
"Config",
",",
"browserCacheSize",
"int",
")",
"func",
"(",
")",
"{",
"am",
":=",
"NewAutogitManager",
"(",
"config",
",",
"browserCacheSize",
")",
"\n",
"rw",
":=",
"rootWrapper",
"{",
"am",
"}",
"\n"... | // StartAutogit launches autogit, and returns a function that should
// be called on shutdown. | [
"StartAutogit",
"launches",
"autogit",
"and",
"returns",
"a",
"function",
"that",
"should",
"be",
"called",
"on",
"shutdown",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libgit/autogit_manager.go#L366-L371 |
159,247 | keybase/client | go/install/install.go | Description | func (c ComponentName) Description() string {
switch c {
case ComponentNameService:
return "Service"
case ComponentNameKBFS:
return "KBFS"
case ComponentNameApp:
return "App"
case ComponentNameCLI:
return "Command Line"
case ComponentNameUpdater:
return "Updater"
case ComponentNameFuse:
return "Fuse"... | go | func (c ComponentName) Description() string {
switch c {
case ComponentNameService:
return "Service"
case ComponentNameKBFS:
return "KBFS"
case ComponentNameApp:
return "App"
case ComponentNameCLI:
return "Command Line"
case ComponentNameUpdater:
return "Updater"
case ComponentNameFuse:
return "Fuse"... | [
"func",
"(",
"c",
"ComponentName",
")",
"Description",
"(",
")",
"string",
"{",
"switch",
"c",
"{",
"case",
"ComponentNameService",
":",
"return",
"\"",
"\"",
"\n",
"case",
"ComponentNameKBFS",
":",
"return",
"\"",
"\"",
"\n",
"case",
"ComponentNameApp",
":"... | // Description returns description for component name | [
"Description",
"returns",
"description",
"for",
"component",
"name"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/install/install.go#L79-L103 |
159,248 | keybase/client | go/install/install.go | ComponentNameFromString | func ComponentNameFromString(s string) ComponentName {
switch s {
case string(ComponentNameCLI):
return ComponentNameCLI
case string(ComponentNameService):
return ComponentNameService
case string(ComponentNameKBFS):
return ComponentNameKBFS
case string(ComponentNameKBNM):
return ComponentNameKBNM
case str... | go | func ComponentNameFromString(s string) ComponentName {
switch s {
case string(ComponentNameCLI):
return ComponentNameCLI
case string(ComponentNameService):
return ComponentNameService
case string(ComponentNameKBFS):
return ComponentNameKBFS
case string(ComponentNameKBNM):
return ComponentNameKBNM
case str... | [
"func",
"ComponentNameFromString",
"(",
"s",
"string",
")",
"ComponentName",
"{",
"switch",
"s",
"{",
"case",
"string",
"(",
"ComponentNameCLI",
")",
":",
"return",
"ComponentNameCLI",
"\n",
"case",
"string",
"(",
"ComponentNameService",
")",
":",
"return",
"Com... | // ComponentNameFromString returns ComponentName from a string | [
"ComponentNameFromString",
"returns",
"ComponentName",
"from",
"a",
"string"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/install/install.go#L106-L130 |
159,249 | keybase/client | go/install/install.go | ResolveInstallStatus | func ResolveInstallStatus(version string, bundleVersion string, lastExitStatus string, log Log) (installStatus keybase1.InstallStatus, installAction keybase1.InstallAction, status keybase1.Status) {
installStatus = keybase1.InstallStatus_UNKNOWN
installAction = keybase1.InstallAction_UNKNOWN
if version != "" && bund... | go | func ResolveInstallStatus(version string, bundleVersion string, lastExitStatus string, log Log) (installStatus keybase1.InstallStatus, installAction keybase1.InstallAction, status keybase1.Status) {
installStatus = keybase1.InstallStatus_UNKNOWN
installAction = keybase1.InstallAction_UNKNOWN
if version != "" && bund... | [
"func",
"ResolveInstallStatus",
"(",
"version",
"string",
",",
"bundleVersion",
"string",
",",
"lastExitStatus",
"string",
",",
"log",
"Log",
")",
"(",
"installStatus",
"keybase1",
".",
"InstallStatus",
",",
"installAction",
"keybase1",
".",
"InstallAction",
",",
... | // ResolveInstallStatus will determine necessary install actions for the current environment | [
"ResolveInstallStatus",
"will",
"determine",
"necessary",
"install",
"actions",
"for",
"the",
"current",
"environment"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/install/install.go#L133-L179 |
159,250 | keybase/client | go/install/install.go | UpdaterBinPath | func UpdaterBinPath() (string, error) {
path, err := BinPath()
if err != nil {
return "", err
}
name, err := updaterBinName()
if err != nil {
return "", err
}
return filepath.Join(filepath.Dir(path), name), nil
} | go | func UpdaterBinPath() (string, error) {
path, err := BinPath()
if err != nil {
return "", err
}
name, err := updaterBinName()
if err != nil {
return "", err
}
return filepath.Join(filepath.Dir(path), name), nil
} | [
"func",
"UpdaterBinPath",
"(",
")",
"(",
"string",
",",
"error",
")",
"{",
"path",
",",
"err",
":=",
"BinPath",
"(",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"\"",
"\"",
",",
"err",
"\n",
"}",
"\n",
"name",
",",
"err",
":=",
"updaterBi... | // UpdaterBinPath returns the path to the updater executable, by default is in
// the same directory as the keybase executable. | [
"UpdaterBinPath",
"returns",
"the",
"path",
"to",
"the",
"updater",
"executable",
"by",
"default",
"is",
"in",
"the",
"same",
"directory",
"as",
"the",
"keybase",
"executable",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/install/install.go#L276-L286 |
159,251 | keybase/client | go/teams/box_public_summary.go | newBoxPublicSummaryFromTable | func newBoxPublicSummaryFromTable(table boxPublicSummaryTable) (*boxPublicSummary, error) {
ret := boxPublicSummary{
table: table,
}
err := ret.encode()
if err != nil {
return nil, err
}
return &ret, nil
} | go | func newBoxPublicSummaryFromTable(table boxPublicSummaryTable) (*boxPublicSummary, error) {
ret := boxPublicSummary{
table: table,
}
err := ret.encode()
if err != nil {
return nil, err
}
return &ret, nil
} | [
"func",
"newBoxPublicSummaryFromTable",
"(",
"table",
"boxPublicSummaryTable",
")",
"(",
"*",
"boxPublicSummary",
",",
"error",
")",
"{",
"ret",
":=",
"boxPublicSummary",
"{",
"table",
":",
"table",
",",
"}",
"\n",
"err",
":=",
"ret",
".",
"encode",
"(",
")"... | // encode only ever gets called with the boxPublicSummary is being constructed. This means
// we don't allow mutation. Thus, we just encode it once, since if ever canonical encoding
// stops working, it won't matter, we'll still get consistent results. | [
"encode",
"only",
"ever",
"gets",
"called",
"with",
"the",
"boxPublicSummary",
"is",
"being",
"constructed",
".",
"This",
"means",
"we",
"don",
"t",
"allow",
"mutation",
".",
"Thus",
"we",
"just",
"encode",
"it",
"once",
"since",
"if",
"ever",
"canonical",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/teams/box_public_summary.go#L33-L42 |
159,252 | keybase/client | go/libkb/secret_store_secretservice.go | GetUsersWithStoredSecrets | func (s *SecretStoreRevokableSecretService) GetUsersWithStoredSecrets(mctx MetaContext) (usernames []string, err error) {
defer mctx.TraceTimed("SecretStoreRevokableSecretService.GetUsersWithStoredSecrets", func() error { return err })()
identifierKeystore := s.identifierKeystore(mctx)
suffixedUsernames, err := iden... | go | func (s *SecretStoreRevokableSecretService) GetUsersWithStoredSecrets(mctx MetaContext) (usernames []string, err error) {
defer mctx.TraceTimed("SecretStoreRevokableSecretService.GetUsersWithStoredSecrets", func() error { return err })()
identifierKeystore := s.identifierKeystore(mctx)
suffixedUsernames, err := iden... | [
"func",
"(",
"s",
"*",
"SecretStoreRevokableSecretService",
")",
"GetUsersWithStoredSecrets",
"(",
"mctx",
"MetaContext",
")",
"(",
"usernames",
"[",
"]",
"string",
",",
"err",
"error",
")",
"{",
"defer",
"mctx",
".",
"TraceTimed",
"(",
"\"",
"\"",
",",
"fun... | // Note that in the case of corruption, not all of these usernames may actually
// be able to be logged in as due to the noise file being corrupted, the
// keyring being uninstalled, etc. | [
"Note",
"that",
"in",
"the",
"case",
"of",
"corruption",
"not",
"all",
"of",
"these",
"usernames",
"may",
"actually",
"be",
"able",
"to",
"be",
"logged",
"in",
"as",
"due",
"to",
"the",
"noise",
"file",
"being",
"corrupted",
"the",
"keyring",
"being",
"u... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/libkb/secret_store_secretservice.go#L269-L280 |
159,253 | keybase/client | go/stellar/build.go | identifyForReview | func identifyForReview(mctx libkb.MetaContext, assertion string,
successCh chan<- struct{},
trackFailCh chan<- struct{},
errCh chan<- error) {
// Goroutines that are blocked on otherwise unreachable channels are not GC'd.
// So use ctx to clean up.
sendSuccess := func() {
mctx.Debug("identifyForReview(%v) -> su... | go | func identifyForReview(mctx libkb.MetaContext, assertion string,
successCh chan<- struct{},
trackFailCh chan<- struct{},
errCh chan<- error) {
// Goroutines that are blocked on otherwise unreachable channels are not GC'd.
// So use ctx to clean up.
sendSuccess := func() {
mctx.Debug("identifyForReview(%v) -> su... | [
"func",
"identifyForReview",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"assertion",
"string",
",",
"successCh",
"chan",
"<-",
"struct",
"{",
"}",
",",
"trackFailCh",
"chan",
"<-",
"struct",
"{",
"}",
",",
"errCh",
"chan",
"<-",
"error",
")",
"{",
"/... | // identifyForReview runs identify on a user, looking only for tracking breaks.
// Sends a value to exactly one of the three channels. | [
"identifyForReview",
"runs",
"identify",
"on",
"a",
"user",
"looking",
"only",
"for",
"tracking",
"breaks",
".",
"Sends",
"a",
"value",
"to",
"exactly",
"one",
"of",
"the",
"three",
"channels",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/build.go#L507-L564 |
159,254 | keybase/client | go/stellar/build.go | isFollowingForReview | func isFollowingForReview(mctx libkb.MetaContext, assertion string) (isFollowing bool, err error) {
// The 'following' check blocks sending, and is not that important, so impose a timeout.
var cancel func()
mctx, cancel = mctx.WithTimeout(time.Second * 5)
defer cancel()
err = mctx.G().GetFullSelfer().WithSelf(mctx... | go | func isFollowingForReview(mctx libkb.MetaContext, assertion string) (isFollowing bool, err error) {
// The 'following' check blocks sending, and is not that important, so impose a timeout.
var cancel func()
mctx, cancel = mctx.WithTimeout(time.Second * 5)
defer cancel()
err = mctx.G().GetFullSelfer().WithSelf(mctx... | [
"func",
"isFollowingForReview",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"assertion",
"string",
")",
"(",
"isFollowing",
"bool",
",",
"err",
"error",
")",
"{",
"// The 'following' check blocks sending, and is not that important, so impose a timeout.",
"var",
"cancel",... | // Whether the logged-in user following the recipient.
// Unresolved assertions will false negative. | [
"Whether",
"the",
"logged",
"-",
"in",
"user",
"following",
"the",
"recipient",
".",
"Unresolved",
"assertions",
"will",
"false",
"negative",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/build.go#L568-L590 |
159,255 | keybase/client | go/stellar/build.go | SubtractFeeSoft | func SubtractFeeSoft(mctx libkb.MetaContext, availableStr string, baseFee uint64) string {
available, err := stellarnet.ParseStellarAmount(availableStr)
if err != nil {
mctx.Debug("error parsing available balance: %v", err)
return availableStr
}
available -= int64(baseFee)
if available < 0 {
available = 0
}... | go | func SubtractFeeSoft(mctx libkb.MetaContext, availableStr string, baseFee uint64) string {
available, err := stellarnet.ParseStellarAmount(availableStr)
if err != nil {
mctx.Debug("error parsing available balance: %v", err)
return availableStr
}
available -= int64(baseFee)
if available < 0 {
available = 0
}... | [
"func",
"SubtractFeeSoft",
"(",
"mctx",
"libkb",
".",
"MetaContext",
",",
"availableStr",
"string",
",",
"baseFee",
"uint64",
")",
"string",
"{",
"available",
",",
"err",
":=",
"stellarnet",
".",
"ParseStellarAmount",
"(",
"availableStr",
")",
"\n",
"if",
"err... | // Subtract baseFee from the available balance.
// This shows the real available balance assuming an intent to send a 1 op tx.
// Does not error out, just shows the inaccurate answer. | [
"Subtract",
"baseFee",
"from",
"the",
"available",
"balance",
".",
"This",
"shows",
"the",
"real",
"available",
"balance",
"assuming",
"an",
"intent",
"to",
"send",
"a",
"1",
"op",
"tx",
".",
"Does",
"not",
"error",
"out",
"just",
"shows",
"the",
"inaccura... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/build.go#L892-L903 |
159,256 | keybase/client | go/stellar/build.go | CheckReadyToSend | func (b *buildPaymentData) CheckReadyToSend(arg stellar1.SendPaymentLocalArg) error {
if !b.ReadyToSend {
if !b.ReadyToReview {
// Payment is not even ready for review.
return fmt.Errorf("this payment is not ready to send")
}
// Payment is ready to review but has not been reviewed.
return fmt.Errorf("thi... | go | func (b *buildPaymentData) CheckReadyToSend(arg stellar1.SendPaymentLocalArg) error {
if !b.ReadyToSend {
if !b.ReadyToReview {
// Payment is not even ready for review.
return fmt.Errorf("this payment is not ready to send")
}
// Payment is ready to review but has not been reviewed.
return fmt.Errorf("thi... | [
"func",
"(",
"b",
"*",
"buildPaymentData",
")",
"CheckReadyToSend",
"(",
"arg",
"stellar1",
".",
"SendPaymentLocalArg",
")",
"error",
"{",
"if",
"!",
"b",
".",
"ReadyToSend",
"{",
"if",
"!",
"b",
".",
"ReadyToReview",
"{",
"// Payment is not even ready for revie... | // Ready decides whether the frozen payment has been prechecked and
// the Send request matches it. | [
"Ready",
"decides",
"whether",
"the",
"frozen",
"payment",
"has",
"been",
"prechecked",
"and",
"the",
"Send",
"request",
"matches",
"it",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/stellar/build.go#L945-L975 |
159,257 | keybase/client | go/kbfs/libfs/tlf_edit_history_file.go | GetEncodedTlfEditHistory | func GetEncodedTlfEditHistory(ctx context.Context, config libkbfs.Config,
folderBranch data.FolderBranch) (
data []byte, t time.Time, err error) {
edits, err := config.KBFSOps().GetEditHistory(ctx, folderBranch)
if err != nil {
return nil, time.Time{}, err
}
data, err = PrettyJSON(edits)
return data, time.Tim... | go | func GetEncodedTlfEditHistory(ctx context.Context, config libkbfs.Config,
folderBranch data.FolderBranch) (
data []byte, t time.Time, err error) {
edits, err := config.KBFSOps().GetEditHistory(ctx, folderBranch)
if err != nil {
return nil, time.Time{}, err
}
data, err = PrettyJSON(edits)
return data, time.Tim... | [
"func",
"GetEncodedTlfEditHistory",
"(",
"ctx",
"context",
".",
"Context",
",",
"config",
"libkbfs",
".",
"Config",
",",
"folderBranch",
"data",
".",
"FolderBranch",
")",
"(",
"data",
"[",
"]",
"byte",
",",
"t",
"time",
".",
"Time",
",",
"err",
"error",
... | // GetEncodedTlfEditHistory returns serialized JSON containing the
// file edit history for a folder. | [
"GetEncodedTlfEditHistory",
"returns",
"serialized",
"JSON",
"containing",
"the",
"file",
"edit",
"history",
"for",
"a",
"folder",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libfs/tlf_edit_history_file.go#L17-L27 |
159,258 | keybase/client | go/kbfs/libkbfs/crypto_common.go | MakeCryptoCommon | func MakeCryptoCommon(
codec kbfscodec.Codec,
blockCryptVersioner blockCryptVersioner) CryptoCommon {
return CryptoCommon{codec, blockCryptVersioner}
} | go | func MakeCryptoCommon(
codec kbfscodec.Codec,
blockCryptVersioner blockCryptVersioner) CryptoCommon {
return CryptoCommon{codec, blockCryptVersioner}
} | [
"func",
"MakeCryptoCommon",
"(",
"codec",
"kbfscodec",
".",
"Codec",
",",
"blockCryptVersioner",
"blockCryptVersioner",
")",
"CryptoCommon",
"{",
"return",
"CryptoCommon",
"{",
"codec",
",",
"blockCryptVersioner",
"}",
"\n",
"}"
] | // MakeCryptoCommon returns a default CryptoCommon object. | [
"MakeCryptoCommon",
"returns",
"a",
"default",
"CryptoCommon",
"object",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L30-L34 |
159,259 | keybase/client | go/kbfs/libkbfs/crypto_common.go | MakeRandomTlfID | func (c CryptoCommon) MakeRandomTlfID(t tlf.Type) (tlf.ID, error) {
return tlf.MakeRandomID(t)
} | go | func (c CryptoCommon) MakeRandomTlfID(t tlf.Type) (tlf.ID, error) {
return tlf.MakeRandomID(t)
} | [
"func",
"(",
"c",
"CryptoCommon",
")",
"MakeRandomTlfID",
"(",
"t",
"tlf",
".",
"Type",
")",
"(",
"tlf",
".",
"ID",
",",
"error",
")",
"{",
"return",
"tlf",
".",
"MakeRandomID",
"(",
"t",
")",
"\n",
"}"
] | // MakeRandomTlfID implements the Crypto interface for CryptoCommon. | [
"MakeRandomTlfID",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L37-L39 |
159,260 | keybase/client | go/kbfs/libkbfs/crypto_common.go | MakeBlockRefNonce | func (c CryptoCommon) MakeBlockRefNonce() (nonce kbfsblock.RefNonce, err error) {
return kbfsblock.MakeRefNonce()
} | go | func (c CryptoCommon) MakeBlockRefNonce() (nonce kbfsblock.RefNonce, err error) {
return kbfsblock.MakeRefNonce()
} | [
"func",
"(",
"c",
"CryptoCommon",
")",
"MakeBlockRefNonce",
"(",
")",
"(",
"nonce",
"kbfsblock",
".",
"RefNonce",
",",
"err",
"error",
")",
"{",
"return",
"kbfsblock",
".",
"MakeRefNonce",
"(",
")",
"\n",
"}"
] | // MakeBlockRefNonce implements the Crypto interface for CryptoCommon. | [
"MakeBlockRefNonce",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L52-L54 |
159,261 | keybase/client | go/kbfs/libkbfs/crypto_common.go | MakeRandomTLFEphemeralKeys | func (c CryptoCommon) MakeRandomTLFEphemeralKeys() (
kbfscrypto.TLFEphemeralPublicKey, kbfscrypto.TLFEphemeralPrivateKey,
error) {
return kbfscrypto.MakeRandomTLFEphemeralKeys()
} | go | func (c CryptoCommon) MakeRandomTLFEphemeralKeys() (
kbfscrypto.TLFEphemeralPublicKey, kbfscrypto.TLFEphemeralPrivateKey,
error) {
return kbfscrypto.MakeRandomTLFEphemeralKeys()
} | [
"func",
"(",
"c",
"CryptoCommon",
")",
"MakeRandomTLFEphemeralKeys",
"(",
")",
"(",
"kbfscrypto",
".",
"TLFEphemeralPublicKey",
",",
"kbfscrypto",
".",
"TLFEphemeralPrivateKey",
",",
"error",
")",
"{",
"return",
"kbfscrypto",
".",
"MakeRandomTLFEphemeralKeys",
"(",
... | // MakeRandomTLFEphemeralKeys implements the Crypto interface for
// CryptoCommon. | [
"MakeRandomTLFEphemeralKeys",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L65-L69 |
159,262 | keybase/client | go/kbfs/libkbfs/crypto_common.go | MakeRandomTLFKeys | func (c CryptoCommon) MakeRandomTLFKeys() (kbfscrypto.TLFPublicKey,
kbfscrypto.TLFPrivateKey, kbfscrypto.TLFCryptKey, error) {
publicKey, privateKey, err := box.GenerateKey(rand.Reader)
if err != nil {
return kbfscrypto.TLFPublicKey{}, kbfscrypto.TLFPrivateKey{},
kbfscrypto.TLFCryptKey{}, errors.WithStack(err)
... | go | func (c CryptoCommon) MakeRandomTLFKeys() (kbfscrypto.TLFPublicKey,
kbfscrypto.TLFPrivateKey, kbfscrypto.TLFCryptKey, error) {
publicKey, privateKey, err := box.GenerateKey(rand.Reader)
if err != nil {
return kbfscrypto.TLFPublicKey{}, kbfscrypto.TLFPrivateKey{},
kbfscrypto.TLFCryptKey{}, errors.WithStack(err)
... | [
"func",
"(",
"c",
"CryptoCommon",
")",
"MakeRandomTLFKeys",
"(",
")",
"(",
"kbfscrypto",
".",
"TLFPublicKey",
",",
"kbfscrypto",
".",
"TLFPrivateKey",
",",
"kbfscrypto",
".",
"TLFCryptKey",
",",
"error",
")",
"{",
"publicKey",
",",
"privateKey",
",",
"err",
... | // MakeRandomTLFKeys implements the Crypto interface for CryptoCommon. | [
"MakeRandomTLFKeys",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L72-L90 |
159,263 | keybase/client | go/kbfs/libkbfs/crypto_common.go | EncryptPrivateMetadata | func (c CryptoCommon) EncryptPrivateMetadata(
pmd PrivateMetadata, key kbfscrypto.TLFCryptKey) (
encryptedPmd kbfscrypto.EncryptedPrivateMetadata, err error) {
encodedPmd, err := c.codec.Encode(pmd)
if err != nil {
return kbfscrypto.EncryptedPrivateMetadata{}, err
}
return kbfscrypto.EncryptEncodedPrivateMetad... | go | func (c CryptoCommon) EncryptPrivateMetadata(
pmd PrivateMetadata, key kbfscrypto.TLFCryptKey) (
encryptedPmd kbfscrypto.EncryptedPrivateMetadata, err error) {
encodedPmd, err := c.codec.Encode(pmd)
if err != nil {
return kbfscrypto.EncryptedPrivateMetadata{}, err
}
return kbfscrypto.EncryptEncodedPrivateMetad... | [
"func",
"(",
"c",
"CryptoCommon",
")",
"EncryptPrivateMetadata",
"(",
"pmd",
"PrivateMetadata",
",",
"key",
"kbfscrypto",
".",
"TLFCryptKey",
")",
"(",
"encryptedPmd",
"kbfscrypto",
".",
"EncryptedPrivateMetadata",
",",
"err",
"error",
")",
"{",
"encodedPmd",
",",... | // EncryptPrivateMetadata implements the Crypto interface for CryptoCommon. | [
"EncryptPrivateMetadata",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L93-L102 |
159,264 | keybase/client | go/kbfs/libkbfs/crypto_common.go | DecryptPrivateMetadata | func (c CryptoCommon) DecryptPrivateMetadata(
encryptedPmd kbfscrypto.EncryptedPrivateMetadata, key kbfscrypto.TLFCryptKey) (
PrivateMetadata, error) {
encodedPrivateMetadata, err := kbfscrypto.DecryptPrivateMetadata(
encryptedPmd, key)
if err != nil {
return PrivateMetadata{}, err
}
var pmd PrivateMetadata
... | go | func (c CryptoCommon) DecryptPrivateMetadata(
encryptedPmd kbfscrypto.EncryptedPrivateMetadata, key kbfscrypto.TLFCryptKey) (
PrivateMetadata, error) {
encodedPrivateMetadata, err := kbfscrypto.DecryptPrivateMetadata(
encryptedPmd, key)
if err != nil {
return PrivateMetadata{}, err
}
var pmd PrivateMetadata
... | [
"func",
"(",
"c",
"CryptoCommon",
")",
"DecryptPrivateMetadata",
"(",
"encryptedPmd",
"kbfscrypto",
".",
"EncryptedPrivateMetadata",
",",
"key",
"kbfscrypto",
".",
"TLFCryptKey",
")",
"(",
"PrivateMetadata",
",",
"error",
")",
"{",
"encodedPrivateMetadata",
",",
"er... | // DecryptPrivateMetadata implements the Crypto interface for CryptoCommon. | [
"DecryptPrivateMetadata",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L105-L121 |
159,265 | keybase/client | go/kbfs/libkbfs/crypto_common.go | EncryptBlock | func (c CryptoCommon) EncryptBlock(
block data.Block, tlfCryptKey kbfscrypto.TLFCryptKey,
blockServerHalf kbfscrypto.BlockCryptKeyServerHalf) (
plainSize int, encryptedBlock kbfscrypto.EncryptedBlock, err error) {
encodedBlock, err := c.codec.Encode(block)
if err != nil {
return -1, kbfscrypto.EncryptedBlock{}, ... | go | func (c CryptoCommon) EncryptBlock(
block data.Block, tlfCryptKey kbfscrypto.TLFCryptKey,
blockServerHalf kbfscrypto.BlockCryptKeyServerHalf) (
plainSize int, encryptedBlock kbfscrypto.EncryptedBlock, err error) {
encodedBlock, err := c.codec.Encode(block)
if err != nil {
return -1, kbfscrypto.EncryptedBlock{}, ... | [
"func",
"(",
"c",
"CryptoCommon",
")",
"EncryptBlock",
"(",
"block",
"data",
".",
"Block",
",",
"tlfCryptKey",
"kbfscrypto",
".",
"TLFCryptKey",
",",
"blockServerHalf",
"kbfscrypto",
".",
"BlockCryptKeyServerHalf",
")",
"(",
"plainSize",
"int",
",",
"encryptedBloc... | // EncryptBlock implements the Crypto interface for CryptoCommon. | [
"EncryptBlock",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L124-L148 |
159,266 | keybase/client | go/kbfs/libkbfs/crypto_common.go | DecryptBlock | func (c CryptoCommon) DecryptBlock(
encryptedBlock kbfscrypto.EncryptedBlock,
tlfCryptKey kbfscrypto.TLFCryptKey,
blockServerHalf kbfscrypto.BlockCryptKeyServerHalf, block data.Block) error {
var paddedBlock []byte
paddedBlock, err := kbfscrypto.DecryptBlock(
encryptedBlock, tlfCryptKey, blockServerHalf)
if err... | go | func (c CryptoCommon) DecryptBlock(
encryptedBlock kbfscrypto.EncryptedBlock,
tlfCryptKey kbfscrypto.TLFCryptKey,
blockServerHalf kbfscrypto.BlockCryptKeyServerHalf, block data.Block) error {
var paddedBlock []byte
paddedBlock, err := kbfscrypto.DecryptBlock(
encryptedBlock, tlfCryptKey, blockServerHalf)
if err... | [
"func",
"(",
"c",
"CryptoCommon",
")",
"DecryptBlock",
"(",
"encryptedBlock",
"kbfscrypto",
".",
"EncryptedBlock",
",",
"tlfCryptKey",
"kbfscrypto",
".",
"TLFCryptKey",
",",
"blockServerHalf",
"kbfscrypto",
".",
"BlockCryptKeyServerHalf",
",",
"block",
"data",
".",
... | // DecryptBlock implements the Crypto interface for CryptoCommon. | [
"DecryptBlock",
"implements",
"the",
"Crypto",
"interface",
"for",
"CryptoCommon",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/crypto_common.go#L151-L172 |
159,267 | keybase/client | go/chat/convsource.go | patchPaginationLast | func (s *baseConversationSource) patchPaginationLast(ctx context.Context, conv types.UnboxConversationInfo, uid gregor1.UID,
page *chat1.Pagination, msgs []chat1.MessageUnboxed) {
if page == nil || page.Last {
return
}
if len(msgs) == 0 {
s.Debug(ctx, "patchPaginationLast: true - no msgs")
page.Last = true
... | go | func (s *baseConversationSource) patchPaginationLast(ctx context.Context, conv types.UnboxConversationInfo, uid gregor1.UID,
page *chat1.Pagination, msgs []chat1.MessageUnboxed) {
if page == nil || page.Last {
return
}
if len(msgs) == 0 {
s.Debug(ctx, "patchPaginationLast: true - no msgs")
page.Last = true
... | [
"func",
"(",
"s",
"*",
"baseConversationSource",
")",
"patchPaginationLast",
"(",
"ctx",
"context",
".",
"Context",
",",
"conv",
"types",
".",
"UnboxConversationInfo",
",",
"uid",
"gregor1",
".",
"UID",
",",
"page",
"*",
"chat1",
".",
"Pagination",
",",
"msg... | // patchPaginationLast turns on page.Last if the messages are before InboxSource's view of Expunge. | [
"patchPaginationLast",
"turns",
"on",
"page",
".",
"Last",
"if",
"the",
"messages",
"are",
"before",
"InboxSource",
"s",
"view",
"of",
"Expunge",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L163-L185 |
159,268 | keybase/client | go/chat/convsource.go | completeAttachmentUpload | func (s *HybridConversationSource) completeAttachmentUpload(ctx context.Context, msg chat1.MessageUnboxed) {
if msg.GetMessageType() == chat1.MessageType_ATTACHMENT {
outboxID := msg.OutboxID()
if outboxID != nil {
s.G().AttachmentUploader.Complete(ctx, *outboxID)
}
}
} | go | func (s *HybridConversationSource) completeAttachmentUpload(ctx context.Context, msg chat1.MessageUnboxed) {
if msg.GetMessageType() == chat1.MessageType_ATTACHMENT {
outboxID := msg.OutboxID()
if outboxID != nil {
s.G().AttachmentUploader.Complete(ctx, *outboxID)
}
}
} | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"completeAttachmentUpload",
"(",
"ctx",
"context",
".",
"Context",
",",
"msg",
"chat1",
".",
"MessageUnboxed",
")",
"{",
"if",
"msg",
".",
"GetMessageType",
"(",
")",
"==",
"chat1",
".",
"MessageType_ATTA... | // completeAttachmentUpload removes any attachment previews from pending preview storage | [
"completeAttachmentUpload",
"removes",
"any",
"attachment",
"previews",
"from",
"pending",
"preview",
"storage"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L418-L425 |
159,269 | keybase/client | go/chat/convsource.go | notifyReactionUpdates | func (s *HybridConversationSource) notifyReactionUpdates(ctx context.Context, uid gregor1.UID,
convID chat1.ConversationID, msgs []chat1.MessageUnboxed) {
s.Debug(ctx, "notifyReactionUpdates: %d msgs to update", len(msgs))
if len(msgs) > 0 {
conv, err := utils.GetVerifiedConv(ctx, s.G(), uid, convID, types.InboxSo... | go | func (s *HybridConversationSource) notifyReactionUpdates(ctx context.Context, uid gregor1.UID,
convID chat1.ConversationID, msgs []chat1.MessageUnboxed) {
s.Debug(ctx, "notifyReactionUpdates: %d msgs to update", len(msgs))
if len(msgs) > 0 {
conv, err := utils.GetVerifiedConv(ctx, s.G(), uid, convID, types.InboxSo... | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"notifyReactionUpdates",
"(",
"ctx",
"context",
".",
"Context",
",",
"uid",
"gregor1",
".",
"UID",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"msgs",
"[",
"]",
"chat1",
".",
"MessageUnboxed",
"... | // notifyReactionUpdates notifies the GUI after reactions are received | [
"notifyReactionUpdates",
"notifies",
"the",
"GUI",
"after",
"reactions",
"are",
"received"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L944-L978 |
159,270 | keybase/client | go/chat/convsource.go | notifyEphemeralPurge | func (s *HybridConversationSource) notifyEphemeralPurge(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, explodedMsgs []chat1.MessageUnboxed) {
s.Debug(ctx, "notifyEphemeralPurge: exploded: %d", len(explodedMsgs))
if len(explodedMsgs) > 0 {
// Blast out an EphemeralPurgeNotifInfo since it's time s... | go | func (s *HybridConversationSource) notifyEphemeralPurge(ctx context.Context, uid gregor1.UID, convID chat1.ConversationID, explodedMsgs []chat1.MessageUnboxed) {
s.Debug(ctx, "notifyEphemeralPurge: exploded: %d", len(explodedMsgs))
if len(explodedMsgs) > 0 {
// Blast out an EphemeralPurgeNotifInfo since it's time s... | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"notifyEphemeralPurge",
"(",
"ctx",
"context",
".",
"Context",
",",
"uid",
"gregor1",
".",
"UID",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"explodedMsgs",
"[",
"]",
"chat1",
".",
"MessageUnboxe... | // notifyEphemeralPurge notifies the GUI after messages are exploded. | [
"notifyEphemeralPurge",
"notifies",
"the",
"GUI",
"after",
"messages",
"are",
"exploded",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L981-L1009 |
159,271 | keybase/client | go/chat/convsource.go | Expunge | func (s *HybridConversationSource) Expunge(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, expunge chat1.Expunge) (err error) {
defer s.Trace(ctx, func() error { return err }, "Expunge")()
s.Debug(ctx, "Expunge: convID: %s uid: %s upto: %v", convID, uid, expunge.Upto)
if expunge.Upto == 0 {
// ... | go | func (s *HybridConversationSource) Expunge(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, expunge chat1.Expunge) (err error) {
defer s.Trace(ctx, func() error { return err }, "Expunge")()
s.Debug(ctx, "Expunge: convID: %s uid: %s upto: %v", convID, uid, expunge.Upto)
if expunge.Upto == 0 {
// ... | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"Expunge",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"expunge",
"chat1",
".",
"Expunge",
")",
"(",
"err",
"error",
... | // Expunge from storage and maybe notify the gui of staleness | [
"Expunge",
"from",
"storage",
"and",
"maybe",
"notify",
"the",
"gui",
"of",
"staleness"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L1012-L1030 |
159,272 | keybase/client | go/chat/convsource.go | mergeMaybeNotify | func (s *HybridConversationSource) mergeMaybeNotify(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) error {
mergeRes, err := s.storage.Merge(ctx, convID, uid, msgs)
if err != nil {
return err
}
s.notifyExpunge(ctx, uid, convID, mergeRes)
s.notifyEphemeralPurge(ct... | go | func (s *HybridConversationSource) mergeMaybeNotify(ctx context.Context,
convID chat1.ConversationID, uid gregor1.UID, msgs []chat1.MessageUnboxed) error {
mergeRes, err := s.storage.Merge(ctx, convID, uid, msgs)
if err != nil {
return err
}
s.notifyExpunge(ctx, uid, convID, mergeRes)
s.notifyEphemeralPurge(ct... | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"mergeMaybeNotify",
"(",
"ctx",
"context",
".",
"Context",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"uid",
"gregor1",
".",
"UID",
",",
"msgs",
"[",
"]",
"chat1",
".",
"MessageUnboxed",
")",
... | // Merge with storage and maybe notify the gui of staleness | [
"Merge",
"with",
"storage",
"and",
"maybe",
"notify",
"the",
"gui",
"of",
"staleness"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L1033-L1046 |
159,273 | keybase/client | go/chat/convsource.go | ClearFromDelete | func (s *HybridConversationSource) ClearFromDelete(ctx context.Context, uid gregor1.UID,
convID chat1.ConversationID, deleteID chat1.MessageID) bool {
defer s.Trace(ctx, func() error { return nil }, "ClearFromDelete")()
// Check to see if we have the message stored
stored, err := s.storage.FetchMessages(ctx, convI... | go | func (s *HybridConversationSource) ClearFromDelete(ctx context.Context, uid gregor1.UID,
convID chat1.ConversationID, deleteID chat1.MessageID) bool {
defer s.Trace(ctx, func() error { return nil }, "ClearFromDelete")()
// Check to see if we have the message stored
stored, err := s.storage.FetchMessages(ctx, convI... | [
"func",
"(",
"s",
"*",
"HybridConversationSource",
")",
"ClearFromDelete",
"(",
"ctx",
"context",
".",
"Context",
",",
"uid",
"gregor1",
".",
"UID",
",",
"convID",
"chat1",
".",
"ConversationID",
",",
"deleteID",
"chat1",
".",
"MessageID",
")",
"bool",
"{",
... | // ClearFromDelete clears the current cache if there is a delete that we don't know about
// and returns true to the caller if it schedules a background loader job | [
"ClearFromDelete",
"clears",
"the",
"current",
"cache",
"if",
"there",
"is",
"a",
"delete",
"that",
"we",
"don",
"t",
"know",
"about",
"and",
"returns",
"true",
"to",
"the",
"caller",
"if",
"it",
"schedules",
"a",
"background",
"loader",
"job"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/chat/convsource.go#L1063-L1089 |
159,274 | keybase/client | go/kbfs/data/prev_revisions.go | AddRevision | func (pr PrevRevisions) AddRevision(
r, minRev kbfsmd.Revision) (ret PrevRevisions) {
newLength := len(pr)
if newLength < len(minPrevRevisionSlotCounts) {
newLength++
}
ret = make(PrevRevisions, newLength)
copy(ret, pr)
earliestGoodSlot := 0
numDropped := 0
// First we eliminate any revisions in the current... | go | func (pr PrevRevisions) AddRevision(
r, minRev kbfsmd.Revision) (ret PrevRevisions) {
newLength := len(pr)
if newLength < len(minPrevRevisionSlotCounts) {
newLength++
}
ret = make(PrevRevisions, newLength)
copy(ret, pr)
earliestGoodSlot := 0
numDropped := 0
// First we eliminate any revisions in the current... | [
"func",
"(",
"pr",
"PrevRevisions",
")",
"AddRevision",
"(",
"r",
",",
"minRev",
"kbfsmd",
".",
"Revision",
")",
"(",
"ret",
"PrevRevisions",
")",
"{",
"newLength",
":=",
"len",
"(",
"pr",
")",
"\n",
"if",
"newLength",
"<",
"len",
"(",
"minPrevRevisionSl... | // AddRevision returns a copy of `pr` with a new immediately-previous
// revision added, with the existing entries moved or overwritten to
// accomodate the new entry, and with increased counts. Any existing
// revisions smaller than or equal to minRev will be removed. | [
"AddRevision",
"returns",
"a",
"copy",
"of",
"pr",
"with",
"a",
"new",
"immediately",
"-",
"previous",
"revision",
"added",
"with",
"the",
"existing",
"entries",
"moved",
"or",
"overwritten",
"to",
"accomodate",
"the",
"new",
"entry",
"and",
"with",
"increased... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/data/prev_revisions.go#L36-L172 |
159,275 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetState | func (fbo *folderBlockOps) GetState(
lState *kbfssync.LockState) overallBlockState {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
if len(fbo.dirtyFiles) == 0 && len(fbo.dirtyDirs) == 0 &&
fbo.dirtyRootDirEntry == nil {
return cleanState
}
return dirtyState
} | go | func (fbo *folderBlockOps) GetState(
lState *kbfssync.LockState) overallBlockState {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
if len(fbo.dirtyFiles) == 0 && len(fbo.dirtyDirs) == 0 &&
fbo.dirtyRootDirEntry == nil {
return cleanState
}
return dirtyState
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetState",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
")",
"overallBlockState",
"{",
"fbo",
".",
"blockLock",
".",
"RLock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
".",
"blockLock",
".",
"RUnlock",
... | // GetState returns the overall block state of this TLF. | [
"GetState",
"returns",
"the",
"overall",
"block",
"state",
"of",
"this",
"TLF",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L254-L263 |
159,276 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | getCleanEncodedBlockSizeLocked | func (fbo *folderBlockOps) getCleanEncodedBlockSizeLocked(ctx context.Context,
lState *kbfssync.LockState, kmd libkey.KeyMetadata, ptr data.BlockPointer,
branch data.BranchName, rtype data.BlockReqType, assumeCacheIsLive bool) (
size uint32, status keybase1.BlockStatus, err error) {
if rtype != data.BlockReadParall... | go | func (fbo *folderBlockOps) getCleanEncodedBlockSizeLocked(ctx context.Context,
lState *kbfssync.LockState, kmd libkey.KeyMetadata, ptr data.BlockPointer,
branch data.BranchName, rtype data.BlockReqType, assumeCacheIsLive bool) (
size uint32, status keybase1.BlockStatus, err error) {
if rtype != data.BlockReadParall... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"getCleanEncodedBlockSizeLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"ptr",
"data",
".",
"BlockPointer",
",",
... | // getCleanEncodedBlockHelperLocked retrieves the encoded size of the
// clean block pointed to by ptr, which must be valid, either from the
// cache or from the server. If `rtype` is `blockReadParallel`, it's
// assumed that some coordinating goroutine is holding the correct
// locks, and in that case `lState` must b... | [
"getCleanEncodedBlockHelperLocked",
"retrieves",
"the",
"encoded",
"size",
"of",
"the",
"clean",
"block",
"pointed",
"to",
"by",
"ptr",
"which",
"must",
"be",
"valid",
"either",
"from",
"the",
"cache",
"or",
"from",
"the",
"server",
".",
"If",
"rtype",
"is",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L270-L355 |
159,277 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | ClearChargedTo | func (fbo *folderBlockOps) ClearChargedTo(lState *kbfssync.LockState) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
fbo.chargedTo = keybase1.UserOrTeamID("")
} | go | func (fbo *folderBlockOps) ClearChargedTo(lState *kbfssync.LockState) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
fbo.chargedTo = keybase1.UserOrTeamID("")
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"ClearChargedTo",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
")",
"{",
"fbo",
".",
"blockLock",
".",
"Lock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
".",
"blockLock",
".",
"Unlock",
"(",
"lState",
... | // ClearChargedTo clears out the cached chargedTo UID for this FBO. | [
"ClearChargedTo",
"clears",
"out",
"the",
"cached",
"chargedTo",
"UID",
"for",
"this",
"FBO",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L797-L801 |
159,278 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | deepCopyFileLocked | func (fbo *folderBlockOps) deepCopyFileLocked(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, file data.Path,
dirtyBcache data.DirtyBlockCacheSimple, dataVer data.Ver) (
newTopPtr data.BlockPointer, allChildPtrs []data.BlockPointer, err error) {
// Deep copying doesn't alter any data in us... | go | func (fbo *folderBlockOps) deepCopyFileLocked(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, file data.Path,
dirtyBcache data.DirtyBlockCacheSimple, dataVer data.Ver) (
newTopPtr data.BlockPointer, allChildPtrs []data.BlockPointer, err error) {
// Deep copying doesn't alter any data in us... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"deepCopyFileLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"file",
"data",
".",
"Path",
",",
"dirtyBcache",
"... | // DeepCopyFile makes a complete copy of the given file, deduping leaf
// blocks and making new random BlockPointers for all indirect blocks.
// It returns the new top pointer of the copy, and all the new child
// pointers in the copy. It takes a custom DirtyBlockCache, which
// directs where the resulting block copie... | [
"DeepCopyFile",
"makes",
"a",
"complete",
"copy",
"of",
"the",
"given",
"file",
"deduping",
"leaf",
"blocks",
"and",
"making",
"new",
"random",
"BlockPointers",
"for",
"all",
"indirect",
"blocks",
".",
"It",
"returns",
"the",
"new",
"top",
"pointer",
"of",
"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L808-L824 |
159,279 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | newDirDataWithDBMLocked | func (fbo *folderBlockOps) newDirDataWithDBMLocked(lState *kbfssync.LockState,
dir data.Path, chargedTo keybase1.UserOrTeamID, kmd libkey.KeyMetadata,
dbm dirBlockMap) *data.DirData {
fbo.blockLock.AssertRLocked(lState)
return data.NewDirData(dir, chargedTo, fbo.config.BlockSplitter(), kmd,
func(ctx context.Conte... | go | func (fbo *folderBlockOps) newDirDataWithDBMLocked(lState *kbfssync.LockState,
dir data.Path, chargedTo keybase1.UserOrTeamID, kmd libkey.KeyMetadata,
dbm dirBlockMap) *data.DirData {
fbo.blockLock.AssertRLocked(lState)
return data.NewDirData(dir, chargedTo, fbo.config.BlockSplitter(), kmd,
func(ctx context.Conte... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"newDirDataWithDBMLocked",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"dir",
"data",
".",
"Path",
",",
"chargedTo",
"keybase1",
".",
"UserOrTeamID",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"d... | // newDirDataWithDBMLocked creates a new `dirData` that reads from and
// puts into a local dir block cache. If it reads a block out from
// anything but the `dbm`, it makes a copy of it before inserting it
// into the `dbm`. | [
"newDirDataWithDBMLocked",
"creates",
"a",
"new",
"dirData",
"that",
"reads",
"from",
"and",
"puts",
"into",
"a",
"local",
"dir",
"block",
"cache",
".",
"If",
"it",
"reads",
"a",
"block",
"out",
"from",
"anything",
"but",
"the",
"dbm",
"it",
"makes",
"a",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L978-L1025 |
159,280 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | newDirDataWithDBM | func (fbo *folderBlockOps) newDirDataWithDBM(
lState *kbfssync.LockState, dir data.Path, chargedTo keybase1.UserOrTeamID,
kmd libkey.KeyMetadata, dbm dirBlockMap) (*data.DirData, func()) {
// Lock and fetch for reading only, we want any dirty
// blocks to go into the dbm.
fbo.blockLock.RLock(lState)
cleanupFn := ... | go | func (fbo *folderBlockOps) newDirDataWithDBM(
lState *kbfssync.LockState, dir data.Path, chargedTo keybase1.UserOrTeamID,
kmd libkey.KeyMetadata, dbm dirBlockMap) (*data.DirData, func()) {
// Lock and fetch for reading only, we want any dirty
// blocks to go into the dbm.
fbo.blockLock.RLock(lState)
cleanupFn := ... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"newDirDataWithDBM",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"dir",
"data",
".",
"Path",
",",
"chargedTo",
"keybase1",
".",
"UserOrTeamID",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"dbm",
... | // newDirDataWithDBM is like `newDirDataWithDBMLocked`, but it must be
// called with `blockLock` unlocked, and the returned function must be
// called when the returned `dirData` is no longer in use. | [
"newDirDataWithDBM",
"is",
"like",
"newDirDataWithDBMLocked",
"but",
"it",
"must",
"be",
"called",
"with",
"blockLock",
"unlocked",
"and",
"the",
"returned",
"function",
"must",
"be",
"called",
"when",
"the",
"returned",
"dirData",
"is",
"no",
"longer",
"in",
"u... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1030-L1039 |
159,281 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | AddDirEntryInCache | func (fbo *folderBlockOps) AddDirEntryInCache(
ctx context.Context, lState *kbfssync.LockState, kmd KeyMetadataWithRootDirEntry,
dir data.Path, newName string, newDe data.DirEntry) (dirCacheUndoFn, error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
fn, err := fbo.addDirEntryInCacheLocked(
ctx... | go | func (fbo *folderBlockOps) AddDirEntryInCache(
ctx context.Context, lState *kbfssync.LockState, kmd KeyMetadataWithRootDirEntry,
dir data.Path, newName string, newDe data.DirEntry) (dirCacheUndoFn, error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
fn, err := fbo.addDirEntryInCacheLocked(
ctx... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"AddDirEntryInCache",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"dir",
"data",
".",
"Path",
",",
"newName",
"string",... | // AddDirEntryInCache adds a brand new entry to the given directory
// and updates the directory's own mtime and ctime. It returns a
// function that can be called if the change needs to be undone. | [
"AddDirEntryInCache",
"adds",
"a",
"brand",
"new",
"entry",
"to",
"the",
"given",
"directory",
"and",
"updates",
"the",
"directory",
"s",
"own",
"mtime",
"and",
"ctime",
".",
"It",
"returns",
"a",
"function",
"that",
"can",
"be",
"called",
"if",
"the",
"ch... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1147-L1158 |
159,282 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | SetAttrInDirEntryInCache | func (fbo *folderBlockOps) SetAttrInDirEntryInCache(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, p data.Path, newDe data.DirEntry, attr attrChange) (
dirCacheUndoFn, error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
return fbo.setCachedAttrLocked(
ctx, ... | go | func (fbo *folderBlockOps) SetAttrInDirEntryInCache(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, p data.Path, newDe data.DirEntry, attr attrChange) (
dirCacheUndoFn, error) {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
return fbo.setCachedAttrLocked(
ctx, ... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"SetAttrInDirEntryInCache",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"p",
"data",
".",
"Path",
",",
"newDe",
"data",... | // SetAttrInDirEntryInCache updates an entry from the given directory. | [
"SetAttrInDirEntryInCache",
"updates",
"an",
"entry",
"from",
"the",
"given",
"directory",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1366-L1374 |
159,283 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetDirtyDirCopy | func (fbo *folderBlockOps) GetDirtyDirCopy(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, dir data.Path,
rtype data.BlockReqType) (*data.DirBlock, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
dblock, err := fbo.getDirtyDirLocked(ctx, lState, kmd, dir, rtype)
... | go | func (fbo *folderBlockOps) GetDirtyDirCopy(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, dir data.Path,
rtype data.BlockReqType) (*data.DirBlock, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
dblock, err := fbo.getDirtyDirLocked(ctx, lState, kmd, dir, rtype)
... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetDirtyDirCopy",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"dir",
"data",
".",
"Path",
",",
"rtype",
"data",
"... | // GetDirtyDirCopy returns a deep copy of the directory block for a
// dirty directory, while under lock, updated with all cached dirty
// entries. | [
"GetDirtyDirCopy",
"returns",
"a",
"deep",
"copy",
"of",
"the",
"directory",
"block",
"for",
"a",
"dirty",
"directory",
"while",
"under",
"lock",
"updated",
"with",
"all",
"cached",
"dirty",
"entries",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1396-L1409 |
159,284 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | updateEntryLocked | func (fbo *folderBlockOps) updateEntryLocked(ctx context.Context,
lState *kbfssync.LockState, kmd KeyMetadataWithRootDirEntry, file data.Path,
de data.DirEntry, includeDeleted bool) error {
fbo.blockLock.AssertAnyLocked(lState)
chargedTo, err := fbo.getChargedToLocked(ctx, lState, kmd)
if err != nil {
return er... | go | func (fbo *folderBlockOps) updateEntryLocked(ctx context.Context,
lState *kbfssync.LockState, kmd KeyMetadataWithRootDirEntry, file data.Path,
de data.DirEntry, includeDeleted bool) error {
fbo.blockLock.AssertAnyLocked(lState)
chargedTo, err := fbo.getChargedToLocked(ctx, lState, kmd)
if err != nil {
return er... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"updateEntryLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"file",
"data",
".",
"Path",
",",
"de",
"data",
".",... | // file must have a valid parent. | [
"file",
"must",
"have",
"a",
"valid",
"parent",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1463-L1489 |
159,285 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetEntry | func (fbo *folderBlockOps) GetEntry(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file data.Path) (data.DirEntry, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
return fbo.getEntryLocked(ctx, lState, kmd, file, false)
} | go | func (fbo *folderBlockOps) GetEntry(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file data.Path) (data.DirEntry, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
return fbo.getEntryLocked(ctx, lState, kmd, file, false)
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetEntry",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"file",
"data",
".",
"Path",
")",
"(",
"data",
".",
"DirEnt... | // GetEntry returns the possibly-dirty DirEntry of the given file in
// its parent DirBlock. file must have a valid parent. | [
"GetEntry",
"returns",
"the",
"possibly",
"-",
"dirty",
"DirEntry",
"of",
"the",
"given",
"file",
"in",
"its",
"parent",
"DirBlock",
".",
"file",
"must",
"have",
"a",
"valid",
"parent",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1493-L1499 |
159,286 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | Lookup | func (fbo *folderBlockOps) Lookup(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, dir Node, name string) (
Node, data.DirEntry, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
dirPath := fbo.nodeCache.PathFromNode(dir)
if !dirPath.IsValid() {
return ... | go | func (fbo *folderBlockOps) Lookup(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, dir Node, name string) (
Node, data.DirEntry, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
dirPath := fbo.nodeCache.PathFromNode(dir)
if !dirPath.IsValid() {
return ... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"Lookup",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"dir",
"Node",
",",
"name",
"string",
")",
"(",
"Node",
",",
... | // Lookup returns the possibly-dirty DirEntry of the given file in its
// parent DirBlock, and a Node for the file if it exists. It has to
// do all of this under the block lock to avoid races with
// UpdatePointers. | [
"Lookup",
"returns",
"the",
"possibly",
"-",
"dirty",
"DirEntry",
"of",
"the",
"given",
"file",
"in",
"its",
"parent",
"DirBlock",
"and",
"a",
"Node",
"for",
"the",
"file",
"if",
"it",
"exists",
".",
"It",
"has",
"to",
"do",
"all",
"of",
"this",
"under... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1536-L1559 |
159,287 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | cacheBlockIfNotYetDirtyLocked | func (fbo *folderBlockOps) cacheBlockIfNotYetDirtyLocked(
ctx context.Context, lState *kbfssync.LockState, ptr data.BlockPointer,
file data.Path, block data.Block) error {
fbo.blockLock.AssertLocked(lState)
df := fbo.getOrCreateDirtyFileLocked(lState, file)
needsCaching, isSyncing := df.SetBlockDirty(ptr)
if nee... | go | func (fbo *folderBlockOps) cacheBlockIfNotYetDirtyLocked(
ctx context.Context, lState *kbfssync.LockState, ptr data.BlockPointer,
file data.Path, block data.Block) error {
fbo.blockLock.AssertLocked(lState)
df := fbo.getOrCreateDirtyFileLocked(lState, file)
needsCaching, isSyncing := df.SetBlockDirty(ptr)
if nee... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"cacheBlockIfNotYetDirtyLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"ptr",
"data",
".",
"BlockPointer",
",",
"file",
"data",
".",
"Path",
",",
"block",... | // cacheBlockIfNotYetDirtyLocked puts a block into the cache, but only
// does so if the block isn't already marked as dirty in the cache.
// This is useful when operating on a dirty copy of a block that may
// already be in the cache. | [
"cacheBlockIfNotYetDirtyLocked",
"puts",
"a",
"block",
"into",
"the",
"cache",
"but",
"only",
"does",
"so",
"if",
"the",
"block",
"isn",
"t",
"already",
"marked",
"as",
"dirty",
"in",
"the",
"cache",
".",
"This",
"is",
"useful",
"when",
"operating",
"on",
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1577-L1596 |
159,288 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetDirtyFileBlockRefs | func (fbo *folderBlockOps) GetDirtyFileBlockRefs(
lState *kbfssync.LockState) []data.BlockRef {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
var dirtyRefs []data.BlockRef
for ref := range fbo.unrefCache {
dirtyRefs = append(dirtyRefs, ref)
}
return dirtyRefs
} | go | func (fbo *folderBlockOps) GetDirtyFileBlockRefs(
lState *kbfssync.LockState) []data.BlockRef {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
var dirtyRefs []data.BlockRef
for ref := range fbo.unrefCache {
dirtyRefs = append(dirtyRefs, ref)
}
return dirtyRefs
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetDirtyFileBlockRefs",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
")",
"[",
"]",
"data",
".",
"BlockRef",
"{",
"fbo",
".",
"blockLock",
".",
"RLock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
".",
... | // GetDirtyFileBlockRefs returns a list of references of all known dirty
// files. | [
"GetDirtyFileBlockRefs",
"returns",
"a",
"list",
"of",
"references",
"of",
"all",
"known",
"dirty",
"files",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1619-L1628 |
159,289 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | GetDirtyDirBlockRefs | func (fbo *folderBlockOps) GetDirtyDirBlockRefs(
lState *kbfssync.LockState) []data.BlockRef {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
var dirtyRefs []data.BlockRef
for ptr := range fbo.dirtyDirs {
dirtyRefs = append(dirtyRefs, ptr.Ref())
}
return dirtyRefs
} | go | func (fbo *folderBlockOps) GetDirtyDirBlockRefs(
lState *kbfssync.LockState) []data.BlockRef {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
var dirtyRefs []data.BlockRef
for ptr := range fbo.dirtyDirs {
dirtyRefs = append(dirtyRefs, ptr.Ref())
}
return dirtyRefs
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"GetDirtyDirBlockRefs",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
")",
"[",
"]",
"data",
".",
"BlockRef",
"{",
"fbo",
".",
"blockLock",
".",
"RLock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
".",
... | // GetDirtyDirBlockRefs returns a list of references of all known dirty
// directories. | [
"GetDirtyDirBlockRefs",
"returns",
"a",
"list",
"of",
"references",
"of",
"all",
"known",
"dirty",
"directories",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1632-L1641 |
159,290 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | getDirtyDirUnrefsLocked | func (fbo *folderBlockOps) getDirtyDirUnrefsLocked(
lState *kbfssync.LockState, ptr data.BlockPointer) []data.BlockInfo {
fbo.blockLock.AssertRLocked(lState)
return fbo.dirtyDirs[ptr]
} | go | func (fbo *folderBlockOps) getDirtyDirUnrefsLocked(
lState *kbfssync.LockState, ptr data.BlockPointer) []data.BlockInfo {
fbo.blockLock.AssertRLocked(lState)
return fbo.dirtyDirs[ptr]
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"getDirtyDirUnrefsLocked",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"ptr",
"data",
".",
"BlockPointer",
")",
"[",
"]",
"data",
".",
"BlockInfo",
"{",
"fbo",
".",
"blockLock",
".",
"AssertRLocked",... | // getDirtyDirUnrefsLocked returns a list of block infos that need to be
// unreferenced for the given directory. | [
"getDirtyDirUnrefsLocked",
"returns",
"a",
"list",
"of",
"block",
"infos",
"that",
"need",
"to",
"be",
"unreferenced",
"for",
"the",
"given",
"directory",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1645-L1649 |
159,291 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | Read | func (fbo *folderBlockOps) Read(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, file Node,
dest []byte, off int64) (int64, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
filePath := fbo.nodeCache.PathFromNode(file)
fbo.vlog.CLogf(ctx, libkb.VLog1, "Reading fro... | go | func (fbo *folderBlockOps) Read(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata, file Node,
dest []byte, off int64) (int64, error) {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
filePath := fbo.nodeCache.PathFromNode(file)
fbo.vlog.CLogf(ctx, libkb.VLog1, "Reading fro... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"Read",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"file",
"Node",
",",
"dest",
"[",
"]",
"byte",
",",
"off",
... | // Read reads from the given file into the given buffer at the given
// offset. It returns the number of bytes read and nil, or 0 and the
// error if there was one. | [
"Read",
"reads",
"from",
"the",
"given",
"file",
"into",
"the",
"given",
"buffer",
"at",
"the",
"given",
"offset",
".",
"It",
"returns",
"the",
"number",
"of",
"bytes",
"read",
"and",
"nil",
"or",
"0",
"and",
"the",
"error",
"if",
"there",
"was",
"one"... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1834-L1847 |
159,292 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | writeGetFileLocked | func (fbo *folderBlockOps) writeGetFileLocked(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata,
file data.Path) (*data.FileBlock, error) {
fbo.blockLock.AssertLocked(lState)
session, err := fbo.config.KBPKI().GetCurrentSession(ctx)
if err != nil {
return nil, err
}
isWriter, err := kmd... | go | func (fbo *folderBlockOps) writeGetFileLocked(
ctx context.Context, lState *kbfssync.LockState, kmd libkey.KeyMetadata,
file data.Path) (*data.FileBlock, error) {
fbo.blockLock.AssertLocked(lState)
session, err := fbo.config.KBPKI().GetCurrentSession(ctx)
if err != nil {
return nil, err
}
isWriter, err := kmd... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"writeGetFileLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"libkey",
".",
"KeyMetadata",
",",
"file",
"data",
".",
"Path",
")",
"(",
"*",
"dat... | // writeGetFileLocked checks write permissions explicitly for
// writeDataLocked, truncateLocked etc and returns | [
"writeGetFileLocked",
"checks",
"write",
"permissions",
"explicitly",
"for",
"writeDataLocked",
"truncateLocked",
"etc",
"and",
"returns"
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L1934-L1957 |
159,293 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | truncateExtendLocked | func (fbo *folderBlockOps) truncateExtendLocked(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file data.Path, size uint64,
parentBlocks []data.ParentBlockAndChildIndex) (
WriteRange, []data.BlockPointer, error) {
fblock, err := fbo.writeGetFileLocked(ctx, lState, kmd, file)
if... | go | func (fbo *folderBlockOps) truncateExtendLocked(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file data.Path, size uint64,
parentBlocks []data.ParentBlockAndChildIndex) (
WriteRange, []data.BlockPointer, error) {
fblock, err := fbo.writeGetFileLocked(ctx, lState, kmd, file)
if... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"truncateExtendLocked",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"file",
"data",
".",
"Path",
",",
"size",
"uint64",... | // truncateExtendLocked is called by truncateLocked to extend a file and
// creates a hole. | [
"truncateExtendLocked",
"is",
"called",
"by",
"truncateLocked",
"to",
"extend",
"a",
"file",
"and",
"creates",
"a",
"hole",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2130-L2185 |
159,294 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | Truncate | func (fbo *folderBlockOps) Truncate(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file Node, size uint64) error {
// If there is too much unflushed data, we should wait until some
// of it gets flush so our memory usage doesn't grow without
// bound.
//
// Assume the whole re... | go | func (fbo *folderBlockOps) Truncate(
ctx context.Context, lState *kbfssync.LockState,
kmd KeyMetadataWithRootDirEntry, file Node, size uint64) error {
// If there is too much unflushed data, we should wait until some
// of it gets flush so our memory usage doesn't grow without
// bound.
//
// Assume the whole re... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"Truncate",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"kmd",
"KeyMetadataWithRootDirEntry",
",",
"file",
"Node",
",",
"size",
"uint64",
")",
"error",
"{",
"... | // Truncate truncates or extends the given file to the given size.
// May block if there is too much unflushed data; in that case, it
// will be unblocked by a future sync. | [
"Truncate",
"truncates",
"or",
"extends",
"the",
"given",
"file",
"to",
"the",
"given",
"size",
".",
"May",
"block",
"if",
"there",
"is",
"too",
"much",
"unflushed",
"data",
";",
"in",
"that",
"case",
"it",
"will",
"be",
"unblocked",
"by",
"a",
"future",... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2280-L2353 |
159,295 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | IsDirty | func (fbo *folderBlockOps) IsDirty(lState *kbfssync.LockState, file data.Path) bool {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
// A dirty file should probably match all three of these, but
// check them individually just in case.
if fbo.config.DirtyBlockCache().IsDirty(
fbo.id(), file.Tail... | go | func (fbo *folderBlockOps) IsDirty(lState *kbfssync.LockState, file data.Path) bool {
fbo.blockLock.RLock(lState)
defer fbo.blockLock.RUnlock(lState)
// A dirty file should probably match all three of these, but
// check them individually just in case.
if fbo.config.DirtyBlockCache().IsDirty(
fbo.id(), file.Tail... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"IsDirty",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"file",
"data",
".",
"Path",
")",
"bool",
"{",
"fbo",
".",
"blockLock",
".",
"RLock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
".",
"bl... | // IsDirty returns whether the given file is dirty; if false is
// returned, then the file doesn't need to be synced. | [
"IsDirty",
"returns",
"whether",
"the",
"given",
"file",
"is",
"dirty",
";",
"if",
"false",
"is",
"returned",
"then",
"the",
"file",
"doesn",
"t",
"need",
"to",
"be",
"synced",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2357-L2373 |
159,296 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | ClearCacheInfo | func (fbo *folderBlockOps) ClearCacheInfo(
lState *kbfssync.LockState, file data.Path) error {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
return fbo.clearCacheInfoLocked(lState, file)
} | go | func (fbo *folderBlockOps) ClearCacheInfo(
lState *kbfssync.LockState, file data.Path) error {
fbo.blockLock.Lock(lState)
defer fbo.blockLock.Unlock(lState)
return fbo.clearCacheInfoLocked(lState, file)
} | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"ClearCacheInfo",
"(",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"file",
"data",
".",
"Path",
")",
"error",
"{",
"fbo",
".",
"blockLock",
".",
"Lock",
"(",
"lState",
")",
"\n",
"defer",
"fbo",
"."... | // ClearCacheInfo removes any cached info for the the given file. | [
"ClearCacheInfo",
"removes",
"any",
"cached",
"info",
"for",
"the",
"the",
"given",
"file",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2428-L2433 |
159,297 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | revertSyncInfoAfterRecoverableError | func (fbo *folderBlockOps) revertSyncInfoAfterRecoverableError(
ctx context.Context, blocksToRemove []data.BlockPointer, result fileSyncState) {
si := result.si
savedSi := result.savedSi
// Save the blocks we need to clean up on the next attempt.
toClean := si.toCleanIfUnused
newIndirect := make(map[data.BlockP... | go | func (fbo *folderBlockOps) revertSyncInfoAfterRecoverableError(
ctx context.Context, blocksToRemove []data.BlockPointer, result fileSyncState) {
si := result.si
savedSi := result.savedSi
// Save the blocks we need to clean up on the next attempt.
toClean := si.toCleanIfUnused
newIndirect := make(map[data.BlockP... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"revertSyncInfoAfterRecoverableError",
"(",
"ctx",
"context",
".",
"Context",
",",
"blocksToRemove",
"[",
"]",
"data",
".",
"BlockPointer",
",",
"result",
"fileSyncState",
")",
"{",
"si",
":=",
"result",
".",
"si... | // revertSyncInfoAfterRecoverableError updates the saved sync info to
// include all the blocks from before the error, except for those that
// have encountered recoverable block errors themselves. | [
"revertSyncInfoAfterRecoverableError",
"updates",
"the",
"saved",
"sync",
"info",
"to",
"include",
"all",
"the",
"blocks",
"from",
"before",
"the",
"error",
"except",
"for",
"those",
"that",
"have",
"encountered",
"recoverable",
"block",
"errors",
"themselves",
"."
... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2438-L2483 |
159,298 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | mergeDirtyEntryWithDBM | func (fbo *folderBlockOps) mergeDirtyEntryWithDBM(
ctx context.Context, lState *kbfssync.LockState, file data.Path, md libkey.KeyMetadata,
dbm dirBlockMap, dirtyDe data.DirEntry) error {
// Lock and fetch for reading only, any dirty blocks will go into
// the dbm.
fbo.blockLock.RLock(lState)
defer fbo.blockLock.R... | go | func (fbo *folderBlockOps) mergeDirtyEntryWithDBM(
ctx context.Context, lState *kbfssync.LockState, file data.Path, md libkey.KeyMetadata,
dbm dirBlockMap, dirtyDe data.DirEntry) error {
// Lock and fetch for reading only, any dirty blocks will go into
// the dbm.
fbo.blockLock.RLock(lState)
defer fbo.blockLock.R... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"mergeDirtyEntryWithDBM",
"(",
"ctx",
"context",
".",
"Context",
",",
"lState",
"*",
"kbfssync",
".",
"LockState",
",",
"file",
"data",
".",
"Path",
",",
"md",
"libkey",
".",
"KeyMetadata",
",",
"dbm",
"dirBl... | // mergeDirtyEntryWithDBM sets the entry for a file into a directory,
// storing all the affected blocks into `dbm` rather than the dirty
// block cache. It must only be called with an entry that's already
// been written to the dirty block cache, such that no new blocks are
// dirtied. | [
"mergeDirtyEntryWithDBM",
"sets",
"the",
"entry",
"for",
"a",
"file",
"into",
"a",
"directory",
"storing",
"all",
"the",
"affected",
"blocks",
"into",
"dbm",
"rather",
"than",
"the",
"dirty",
"block",
"cache",
".",
"It",
"must",
"only",
"be",
"called",
"with... | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2695-L2719 |
159,299 | keybase/client | go/kbfs/libkbfs/folder_block_ops.go | cleanUpUnusedBlocks | func (fbo *folderBlockOps) cleanUpUnusedBlocks(ctx context.Context,
md ReadOnlyRootMetadata, syncState fileSyncState, fbm *folderBlockManager) error {
numToClean := len(syncState.si.toCleanIfUnused)
if numToClean == 0 {
return nil
}
// What blocks are referenced in the successful MD?
refs := make(map[data.Bloc... | go | func (fbo *folderBlockOps) cleanUpUnusedBlocks(ctx context.Context,
md ReadOnlyRootMetadata, syncState fileSyncState, fbm *folderBlockManager) error {
numToClean := len(syncState.si.toCleanIfUnused)
if numToClean == 0 {
return nil
}
// What blocks are referenced in the successful MD?
refs := make(map[data.Bloc... | [
"func",
"(",
"fbo",
"*",
"folderBlockOps",
")",
"cleanUpUnusedBlocks",
"(",
"ctx",
"context",
".",
"Context",
",",
"md",
"ReadOnlyRootMetadata",
",",
"syncState",
"fileSyncState",
",",
"fbm",
"*",
"folderBlockManager",
")",
"error",
"{",
"numToClean",
":=",
"len... | // cleanUpUnusedBlocks cleans up the blocks from any previous failed
// sync attempts. | [
"cleanUpUnusedBlocks",
"cleans",
"up",
"the",
"blocks",
"from",
"any",
"previous",
"failed",
"sync",
"attempts",
"."
] | b352622cd8cc94798cfacbcb56ada203c18e519e | https://github.com/keybase/client/blob/b352622cd8cc94798cfacbcb56ada203c18e519e/go/kbfs/libkbfs/folder_block_ops.go#L2847-L2911 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.