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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,000 | gopasspw/gopass | pkg/action/context.go | WithForce | func WithForce(ctx context.Context, force bool) context.Context {
return context.WithValue(ctx, ctxKeyForce, force)
} | go | func WithForce(ctx context.Context, force bool) context.Context {
return context.WithValue(ctx, ctxKeyForce, force)
} | [
"func",
"WithForce",
"(",
"ctx",
"context",
".",
"Context",
",",
"force",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyForce",
",",
"force",
")",
"\n",
"}"
] | // WithForce returns a context with the value for force set | [
"WithForce",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"force",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L31-L33 |
29,001 | gopasspw/gopass | pkg/action/context.go | WithPasswordOnly | func WithPasswordOnly(ctx context.Context, pw bool) context.Context {
return context.WithValue(ctx, ctxKeyPasswordOnly, pw)
} | go | func WithPasswordOnly(ctx context.Context, pw bool) context.Context {
return context.WithValue(ctx, ctxKeyPasswordOnly, pw)
} | [
"func",
"WithPasswordOnly",
"(",
"ctx",
"context",
".",
"Context",
",",
"pw",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyPasswordOnly",
",",
"pw",
")",
"\n",
"}"
] | // WithPasswordOnly returns a context with the value of password only set | [
"WithPasswordOnly",
"returns",
"a",
"context",
"with",
"the",
"value",
"of",
"password",
"only",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L45-L47 |
29,002 | gopasspw/gopass | pkg/action/context.go | WithPrintQR | func WithPrintQR(ctx context.Context, qr bool) context.Context {
return context.WithValue(ctx, ctxKeyPrintQR, qr)
} | go | func WithPrintQR(ctx context.Context, qr bool) context.Context {
return context.WithValue(ctx, ctxKeyPrintQR, qr)
} | [
"func",
"WithPrintQR",
"(",
"ctx",
"context",
".",
"Context",
",",
"qr",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyPrintQR",
",",
"qr",
")",
"\n",
"}"
] | // WithPrintQR returns a context with the value of print QR set | [
"WithPrintQR",
"returns",
"a",
"context",
"with",
"the",
"value",
"of",
"print",
"QR",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L59-L61 |
29,003 | gopasspw/gopass | pkg/action/context.go | WithRevision | func WithRevision(ctx context.Context, rev string) context.Context {
return context.WithValue(ctx, ctxKeyRevision, rev)
} | go | func WithRevision(ctx context.Context, rev string) context.Context {
return context.WithValue(ctx, ctxKeyRevision, rev)
} | [
"func",
"WithRevision",
"(",
"ctx",
"context",
".",
"Context",
",",
"rev",
"string",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyRevision",
",",
"rev",
")",
"\n",
"}"
] | // WithRevision returns a context withe the value of revision set | [
"WithRevision",
"returns",
"a",
"context",
"withe",
"the",
"value",
"of",
"revision",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L73-L75 |
29,004 | gopasspw/gopass | pkg/action/context.go | HasRevision | func HasRevision(ctx context.Context) bool {
sv, ok := ctx.Value(ctxKeyRevision).(string)
return ok && sv != ""
} | go | func HasRevision(ctx context.Context) bool {
sv, ok := ctx.Value(ctxKeyRevision).(string)
return ok && sv != ""
} | [
"func",
"HasRevision",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"sv",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyRevision",
")",
".",
"(",
"string",
")",
"\n",
"return",
"ok",
"&&",
"sv",
"!=",
"\"",
"\"",
"\n",
"}"
] | // HasRevision returns true if a value for revision was set in this context | [
"HasRevision",
"returns",
"true",
"if",
"a",
"value",
"for",
"revision",
"was",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L78-L81 |
29,005 | gopasspw/gopass | pkg/action/context.go | GetRevision | func GetRevision(ctx context.Context) string {
sv, ok := ctx.Value(ctxKeyRevision).(string)
if !ok {
return ""
}
return sv
} | go | func GetRevision(ctx context.Context) string {
sv, ok := ctx.Value(ctxKeyRevision).(string)
if !ok {
return ""
}
return sv
} | [
"func",
"GetRevision",
"(",
"ctx",
"context",
".",
"Context",
")",
"string",
"{",
"sv",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyRevision",
")",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
... | // GetRevision returns the revison set in this context or an empty string | [
"GetRevision",
"returns",
"the",
"revison",
"set",
"in",
"this",
"context",
"or",
"an",
"empty",
"string"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/context.go#L84-L90 |
29,006 | gopasspw/gopass | pkg/backend/registry.go | RegisterCrypto | func RegisterCrypto(id CryptoBackend, name string, loader CryptoLoader) {
cryptoRegistry[id] = loader
cryptoNameToBackendMap[name] = id
cryptoBackendToNameMap[id] = name
} | go | func RegisterCrypto(id CryptoBackend, name string, loader CryptoLoader) {
cryptoRegistry[id] = loader
cryptoNameToBackendMap[name] = id
cryptoBackendToNameMap[id] = name
} | [
"func",
"RegisterCrypto",
"(",
"id",
"CryptoBackend",
",",
"name",
"string",
",",
"loader",
"CryptoLoader",
")",
"{",
"cryptoRegistry",
"[",
"id",
"]",
"=",
"loader",
"\n",
"cryptoNameToBackendMap",
"[",
"name",
"]",
"=",
"id",
"\n",
"cryptoBackendToNameMap",
... | // RegisterCrypto registers a new crypto backend with the backend registry. | [
"RegisterCrypto",
"registers",
"a",
"new",
"crypto",
"backend",
"with",
"the",
"backend",
"registry",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L41-L45 |
29,007 | gopasspw/gopass | pkg/backend/registry.go | NewCrypto | func NewCrypto(ctx context.Context, id CryptoBackend) (Crypto, error) {
if be, found := cryptoRegistry[id]; found {
return be.New(ctx)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | go | func NewCrypto(ctx context.Context, id CryptoBackend) (Crypto, error) {
if be, found := cryptoRegistry[id]; found {
return be.New(ctx)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | [
"func",
"NewCrypto",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"CryptoBackend",
")",
"(",
"Crypto",
",",
"error",
")",
"{",
"if",
"be",
",",
"found",
":=",
"cryptoRegistry",
"[",
"id",
"]",
";",
"found",
"{",
"return",
"be",
".",
"New",
"(",
... | // NewCrypto instantiates a new crypto backend. | [
"NewCrypto",
"instantiates",
"a",
"new",
"crypto",
"backend",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L48-L53 |
29,008 | gopasspw/gopass | pkg/backend/registry.go | RegisterRCS | func RegisterRCS(id RCSBackend, name string, loader RCSLoader) {
rcsRegistry[id] = loader
rcsNameToBackendMap[name] = id
rcsBackendToNameMap[id] = name
} | go | func RegisterRCS(id RCSBackend, name string, loader RCSLoader) {
rcsRegistry[id] = loader
rcsNameToBackendMap[name] = id
rcsBackendToNameMap[id] = name
} | [
"func",
"RegisterRCS",
"(",
"id",
"RCSBackend",
",",
"name",
"string",
",",
"loader",
"RCSLoader",
")",
"{",
"rcsRegistry",
"[",
"id",
"]",
"=",
"loader",
"\n",
"rcsNameToBackendMap",
"[",
"name",
"]",
"=",
"id",
"\n",
"rcsBackendToNameMap",
"[",
"id",
"]"... | // RegisterRCS registers a new RCS backend with the backend registry. | [
"RegisterRCS",
"registers",
"a",
"new",
"RCS",
"backend",
"with",
"the",
"backend",
"registry",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L56-L60 |
29,009 | gopasspw/gopass | pkg/backend/registry.go | OpenRCS | func OpenRCS(ctx context.Context, id RCSBackend, path string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
return be.Open(ctx, path)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | go | func OpenRCS(ctx context.Context, id RCSBackend, path string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
return be.Open(ctx, path)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | [
"func",
"OpenRCS",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"RCSBackend",
",",
"path",
"string",
")",
"(",
"RCS",
",",
"error",
")",
"{",
"if",
"be",
",",
"found",
":=",
"rcsRegistry",
"[",
"id",
"]",
";",
"found",
"{",
"return",
"be",
"."... | // OpenRCS opens an existing repository. | [
"OpenRCS",
"opens",
"an",
"existing",
"repository",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L63-L68 |
29,010 | gopasspw/gopass | pkg/backend/registry.go | CloneRCS | func CloneRCS(ctx context.Context, id RCSBackend, repo, path string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
out.Debug(ctx, "Cloning with %s", be.String())
return be.Clone(ctx, repo, path)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | go | func CloneRCS(ctx context.Context, id RCSBackend, repo, path string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
out.Debug(ctx, "Cloning with %s", be.String())
return be.Clone(ctx, repo, path)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | [
"func",
"CloneRCS",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"RCSBackend",
",",
"repo",
",",
"path",
"string",
")",
"(",
"RCS",
",",
"error",
")",
"{",
"if",
"be",
",",
"found",
":=",
"rcsRegistry",
"[",
"id",
"]",
";",
"found",
"{",
"out"... | // CloneRCS clones an existing repository from a remote. | [
"CloneRCS",
"clones",
"an",
"existing",
"repository",
"from",
"a",
"remote",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L71-L77 |
29,011 | gopasspw/gopass | pkg/backend/registry.go | InitRCS | func InitRCS(ctx context.Context, id RCSBackend, path, name, email string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
return be.Init(ctx, path, name, email)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | go | func InitRCS(ctx context.Context, id RCSBackend, path, name, email string) (RCS, error) {
if be, found := rcsRegistry[id]; found {
return be.Init(ctx, path, name, email)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %d", id)
} | [
"func",
"InitRCS",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"RCSBackend",
",",
"path",
",",
"name",
",",
"email",
"string",
")",
"(",
"RCS",
",",
"error",
")",
"{",
"if",
"be",
",",
"found",
":=",
"rcsRegistry",
"[",
"id",
"]",
";",
"found... | // InitRCS initializes a new repository. | [
"InitRCS",
"initializes",
"a",
"new",
"repository",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L80-L85 |
29,012 | gopasspw/gopass | pkg/backend/registry.go | RegisterStorage | func RegisterStorage(id StorageBackend, name string, loader StorageLoader) {
storageRegistry[id] = loader
storageNameToBackendMap[name] = id
storageBackendToNameMap[id] = name
} | go | func RegisterStorage(id StorageBackend, name string, loader StorageLoader) {
storageRegistry[id] = loader
storageNameToBackendMap[name] = id
storageBackendToNameMap[id] = name
} | [
"func",
"RegisterStorage",
"(",
"id",
"StorageBackend",
",",
"name",
"string",
",",
"loader",
"StorageLoader",
")",
"{",
"storageRegistry",
"[",
"id",
"]",
"=",
"loader",
"\n",
"storageNameToBackendMap",
"[",
"name",
"]",
"=",
"id",
"\n",
"storageBackendToNameMa... | // RegisterStorage registers a new storage backend with the registry. | [
"RegisterStorage",
"registers",
"a",
"new",
"storage",
"backend",
"with",
"the",
"registry",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L88-L92 |
29,013 | gopasspw/gopass | pkg/backend/registry.go | NewStorage | func NewStorage(ctx context.Context, id StorageBackend, url *URL) (Storage, error) {
if be, found := storageRegistry[id]; found {
return be.New(ctx, url)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %s", url.String())
} | go | func NewStorage(ctx context.Context, id StorageBackend, url *URL) (Storage, error) {
if be, found := storageRegistry[id]; found {
return be.New(ctx, url)
}
return nil, errors.Wrapf(ErrNotFound, "unknown backend: %s", url.String())
} | [
"func",
"NewStorage",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"StorageBackend",
",",
"url",
"*",
"URL",
")",
"(",
"Storage",
",",
"error",
")",
"{",
"if",
"be",
",",
"found",
":=",
"storageRegistry",
"[",
"id",
"]",
";",
"found",
"{",
"retu... | // NewStorage initializes a new storage backend. | [
"NewStorage",
"initializes",
"a",
"new",
"storage",
"backend",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/registry.go#L95-L100 |
29,014 | gopasspw/gopass | pkg/action/templates.go | TemplatesPrint | func (s *Action) TemplatesPrint(ctx context.Context, c *cli.Context) error {
tree, err := s.Store.TemplateTree(ctx)
if err != nil {
return ExitError(ctx, ExitList, err, "failed to list templates: %s", err)
}
fmt.Fprintln(stdout, tree.Format(0))
return nil
} | go | func (s *Action) TemplatesPrint(ctx context.Context, c *cli.Context) error {
tree, err := s.Store.TemplateTree(ctx)
if err != nil {
return ExitError(ctx, ExitList, err, "failed to list templates: %s", err)
}
fmt.Fprintln(stdout, tree.Format(0))
return nil
} | [
"func",
"(",
"s",
"*",
"Action",
")",
"TemplatesPrint",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"tree",
",",
"err",
":=",
"s",
".",
"Store",
".",
"TemplateTree",
"(",
"ctx",
")",
"\n",
"if",
... | // TemplatesPrint will pretty-print a tree of templates | [
"TemplatesPrint",
"will",
"pretty",
"-",
"print",
"a",
"tree",
"of",
"templates"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/templates.go#L38-L45 |
29,015 | gopasspw/gopass | pkg/action/templates.go | TemplatePrint | func (s *Action) TemplatePrint(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
content, err := s.Store.GetTemplate(ctx, name)
if err != nil {
return ExitError(ctx, ExitIO, err, "failed to retrieve template: %s", err)
}
fmt.Fprintln(stdout, string(content))
return nil
} | go | func (s *Action) TemplatePrint(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
content, err := s.Store.GetTemplate(ctx, name)
if err != nil {
return ExitError(ctx, ExitIO, err, "failed to retrieve template: %s", err)
}
fmt.Fprintln(stdout, string(content))
return nil
} | [
"func",
"(",
"s",
"*",
"Action",
")",
"TemplatePrint",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"name",
":=",
"c",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"\n\n",
"content",
",",
"err"... | // TemplatePrint will lookup and print a single template | [
"TemplatePrint",
"will",
"lookup",
"and",
"print",
"a",
"single",
"template"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/templates.go#L48-L58 |
29,016 | gopasspw/gopass | pkg/action/templates.go | TemplateEdit | func (s *Action) TemplateEdit(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
var content []byte
if s.Store.HasTemplate(ctx, name) {
var err error
content, err = s.Store.GetTemplate(ctx, name)
if err != nil {
return ExitError(ctx, ExitIO, err, "failed to retrieve template: %s", err)
... | go | func (s *Action) TemplateEdit(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
var content []byte
if s.Store.HasTemplate(ctx, name) {
var err error
content, err = s.Store.GetTemplate(ctx, name)
if err != nil {
return ExitError(ctx, ExitIO, err, "failed to retrieve template: %s", err)
... | [
"func",
"(",
"s",
"*",
"Action",
")",
"TemplateEdit",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"name",
":=",
"c",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"\n\n",
"var",
"content",
"[",... | // TemplateEdit will load and existing or new template into an
// editor | [
"TemplateEdit",
"will",
"load",
"and",
"existing",
"or",
"new",
"template",
"into",
"an",
"editor"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/templates.go#L62-L88 |
29,017 | gopasspw/gopass | pkg/action/templates.go | TemplateRemove | func (s *Action) TemplateRemove(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
if name == "" {
return ExitError(ctx, ExitUsage, nil, "usage: %s templates remove [name]", s.Name)
}
if !s.Store.HasTemplate(ctx, name) {
return ExitError(ctx, ExitNotFound, nil, "template '%s' not found", nam... | go | func (s *Action) TemplateRemove(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
if name == "" {
return ExitError(ctx, ExitUsage, nil, "usage: %s templates remove [name]", s.Name)
}
if !s.Store.HasTemplate(ctx, name) {
return ExitError(ctx, ExitNotFound, nil, "template '%s' not found", nam... | [
"func",
"(",
"s",
"*",
"Action",
")",
"TemplateRemove",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"name",
":=",
"c",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"\n",
"if",
"name",
"==",
... | // TemplateRemove will remove a single template | [
"TemplateRemove",
"will",
"remove",
"a",
"single",
"template"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/templates.go#L91-L102 |
29,018 | gopasspw/gopass | pkg/action/templates.go | TemplatesComplete | func (s *Action) TemplatesComplete(ctx context.Context, c *cli.Context) {
tree, err := s.Store.TemplateTree(ctx)
if err != nil {
fmt.Fprintln(stdout, err)
return
}
for _, v := range tree.List(0) {
fmt.Fprintln(stdout, v)
}
} | go | func (s *Action) TemplatesComplete(ctx context.Context, c *cli.Context) {
tree, err := s.Store.TemplateTree(ctx)
if err != nil {
fmt.Fprintln(stdout, err)
return
}
for _, v := range tree.List(0) {
fmt.Fprintln(stdout, v)
}
} | [
"func",
"(",
"s",
"*",
"Action",
")",
"TemplatesComplete",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"{",
"tree",
",",
"err",
":=",
"s",
".",
"Store",
".",
"TemplateTree",
"(",
"ctx",
")",
"\n",
"if",
"err",
... | // TemplatesComplete prints a list of all templates for bash completion | [
"TemplatesComplete",
"prints",
"a",
"list",
"of",
"all",
"templates",
"for",
"bash",
"completion"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/templates.go#L105-L115 |
29,019 | gopasspw/gopass | pkg/backend/crypto/gpg/cli/version.go | Version | func (g *GPG) Version(ctx context.Context) semver.Version {
return version(ctx, g.Binary())
} | go | func (g *GPG) Version(ctx context.Context) semver.Version {
return version(ctx, g.Binary())
} | [
"func",
"(",
"g",
"*",
"GPG",
")",
"Version",
"(",
"ctx",
"context",
".",
"Context",
")",
"semver",
".",
"Version",
"{",
"return",
"version",
"(",
"ctx",
",",
"g",
".",
"Binary",
"(",
")",
")",
"\n",
"}"
] | // Version will returns GPG version information | [
"Version",
"will",
"returns",
"GPG",
"version",
"information"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/crypto/gpg/cli/version.go#L33-L35 |
29,020 | gopasspw/gopass | pkg/backend/crypto/xc/xcpb/identity.go | ID | func (i Identity) ID() string {
out := i.Name
if i.Comment != "" {
out += " (" + i.Comment + ")"
}
out += " <" + i.Email + ">"
return out
} | go | func (i Identity) ID() string {
out := i.Name
if i.Comment != "" {
out += " (" + i.Comment + ")"
}
out += " <" + i.Email + ">"
return out
} | [
"func",
"(",
"i",
"Identity",
")",
"ID",
"(",
")",
"string",
"{",
"out",
":=",
"i",
".",
"Name",
"\n",
"if",
"i",
".",
"Comment",
"!=",
"\"",
"\"",
"{",
"out",
"+=",
"\"",
"\"",
"+",
"i",
".",
"Comment",
"+",
"\"",
"\"",
"\n",
"}",
"\n",
"o... | // ID returns the GPG ID format | [
"ID",
"returns",
"the",
"GPG",
"ID",
"format"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/crypto/xc/xcpb/identity.go#L4-L11 |
29,021 | gopasspw/gopass | pkg/store/root/write.go | Set | func (r *Store) Set(ctx context.Context, name string, sec store.Secret) error {
ctx, store, name := r.getStore(ctx, name)
return store.Set(ctx, name, sec)
} | go | func (r *Store) Set(ctx context.Context, name string, sec store.Secret) error {
ctx, store, name := r.getStore(ctx, name)
return store.Set(ctx, name, sec)
} | [
"func",
"(",
"r",
"*",
"Store",
")",
"Set",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
"string",
",",
"sec",
"store",
".",
"Secret",
")",
"error",
"{",
"ctx",
",",
"store",
",",
"name",
":=",
"r",
".",
"getStore",
"(",
"ctx",
",",
"name"... | // Set encodes and write the ciphertext of one entry to disk | [
"Set",
"encodes",
"and",
"write",
"the",
"ciphertext",
"of",
"one",
"entry",
"to",
"disk"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/root/write.go#L10-L13 |
29,022 | gopasspw/gopass | pkg/agent/client/context.go | WithClient | func WithClient(ctx context.Context, c *Client) context.Context {
return context.WithValue(ctx, ctxKeyClient, c)
} | go | func WithClient(ctx context.Context, c *Client) context.Context {
return context.WithValue(ctx, ctxKeyClient, c)
} | [
"func",
"WithClient",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"Client",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyClient",
",",
"c",
")",
"\n",
"}"
] | // WithClient returns a context with a client instance set. | [
"WithClient",
"returns",
"a",
"context",
"with",
"a",
"client",
"instance",
"set",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/agent/client/context.go#L12-L14 |
29,023 | gopasspw/gopass | pkg/agent/client/context.go | GetClient | func GetClient(ctx context.Context) *Client {
c, ok := ctx.Value(ctxKeyClient).(*Client)
if !ok {
return nil
}
return c
} | go | func GetClient(ctx context.Context) *Client {
c, ok := ctx.Value(ctxKeyClient).(*Client)
if !ok {
return nil
}
return c
} | [
"func",
"GetClient",
"(",
"ctx",
"context",
".",
"Context",
")",
"*",
"Client",
"{",
"c",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyClient",
")",
".",
"(",
"*",
"Client",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"nil",
"\n",
"}",
"\n",
... | // GetClient returns a client instance, if set. May be nil. | [
"GetClient",
"returns",
"a",
"client",
"instance",
"if",
"set",
".",
"May",
"be",
"nil",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/agent/client/context.go#L17-L23 |
29,024 | gopasspw/gopass | pkg/action/update.go | Update | func (s *Action) Update(ctx context.Context, c *cli.Context) error {
pre := c.Bool("pre")
if s.version.String() == "0.0.0+HEAD" {
out.Error(ctx, "Can not check version against HEAD")
return nil
}
if err := updater.Update(ctx, pre, s.version); err != nil {
return ExitError(ctx, ExitUnknown, err, "Failed to u... | go | func (s *Action) Update(ctx context.Context, c *cli.Context) error {
pre := c.Bool("pre")
if s.version.String() == "0.0.0+HEAD" {
out.Error(ctx, "Can not check version against HEAD")
return nil
}
if err := updater.Update(ctx, pre, s.version); err != nil {
return ExitError(ctx, ExitUnknown, err, "Failed to u... | [
"func",
"(",
"s",
"*",
"Action",
")",
"Update",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"pre",
":=",
"c",
".",
"Bool",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"s",
".",
"version",
".",
"String... | // Update will start the interactive update assistant | [
"Update",
"will",
"start",
"the",
"interactive",
"update",
"assistant"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/update.go#L13-L25 |
29,025 | gopasspw/gopass | pkg/clipboard/unclip.go | Clear | func Clear(ctx context.Context, checksum string, force bool) error {
if clipboard.Unsupported {
return ErrNotSupported
}
cur, err := clipboard.ReadAll()
if err != nil {
return errors.Wrapf(err, "failed to read clipboard: %s", err)
}
hash := fmt.Sprintf("%x", sha256.Sum256([]byte(cur)))
if hash != checksum ... | go | func Clear(ctx context.Context, checksum string, force bool) error {
if clipboard.Unsupported {
return ErrNotSupported
}
cur, err := clipboard.ReadAll()
if err != nil {
return errors.Wrapf(err, "failed to read clipboard: %s", err)
}
hash := fmt.Sprintf("%x", sha256.Sum256([]byte(cur)))
if hash != checksum ... | [
"func",
"Clear",
"(",
"ctx",
"context",
".",
"Context",
",",
"checksum",
"string",
",",
"force",
"bool",
")",
"error",
"{",
"if",
"clipboard",
".",
"Unsupported",
"{",
"return",
"ErrNotSupported",
"\n",
"}",
"\n\n",
"cur",
",",
"err",
":=",
"clipboard",
... | // Clear will attempt to erase the clipboard | [
"Clear",
"will",
"attempt",
"to",
"erase",
"the",
"clipboard"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/clipboard/unclip.go#L15-L45 |
29,026 | gopasspw/gopass | pkg/notify/notify_darwin.go | Notify | func Notify(ctx context.Context, subj, msg string) error {
if os.Getenv("GOPASS_NO_NOTIFY") != "" || !ctxutil.IsNotifications(ctx) {
return nil
}
osas, err := exec.LookPath("osascript")
if err != nil {
return err
}
return exec.Command(
osas,
"-e",
`display notification "`+msg+`" with title "`+subj+`"`,... | go | func Notify(ctx context.Context, subj, msg string) error {
if os.Getenv("GOPASS_NO_NOTIFY") != "" || !ctxutil.IsNotifications(ctx) {
return nil
}
osas, err := exec.LookPath("osascript")
if err != nil {
return err
}
return exec.Command(
osas,
"-e",
`display notification "`+msg+`" with title "`+subj+`"`,... | [
"func",
"Notify",
"(",
"ctx",
"context",
".",
"Context",
",",
"subj",
",",
"msg",
"string",
")",
"error",
"{",
"if",
"os",
".",
"Getenv",
"(",
"\"",
"\"",
")",
"!=",
"\"",
"\"",
"||",
"!",
"ctxutil",
".",
"IsNotifications",
"(",
"ctx",
")",
"{",
... | // Notify displays a desktop notification using osascript | [
"Notify",
"displays",
"a",
"desktop",
"notification",
"using",
"osascript"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/notify/notify_darwin.go#L14-L28 |
29,027 | gopasspw/gopass | pkg/action/show.go | Show | func (s *Action) Show(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
key := c.Args().Get(1)
ctx = s.Store.WithConfig(ctx, name)
ctx = WithClip(ctx, c.Bool("clip"))
ctx = WithForce(ctx, c.Bool("force"))
ctx = WithPrintQR(ctx, c.Bool("qr"))
ctx = WithPasswordOnly(ctx, c.Bool("password"))
c... | go | func (s *Action) Show(ctx context.Context, c *cli.Context) error {
name := c.Args().First()
key := c.Args().Get(1)
ctx = s.Store.WithConfig(ctx, name)
ctx = WithClip(ctx, c.Bool("clip"))
ctx = WithForce(ctx, c.Bool("force"))
ctx = WithPrintQR(ctx, c.Bool("qr"))
ctx = WithPasswordOnly(ctx, c.Bool("password"))
c... | [
"func",
"(",
"s",
"*",
"Action",
")",
"Show",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"name",
":=",
"c",
".",
"Args",
"(",
")",
".",
"First",
"(",
")",
"\n",
"key",
":=",
"c",
".",
"Args... | // Show the content of a secret file | [
"Show",
"the",
"content",
"of",
"a",
"secret",
"file"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/show.go#L25-L46 |
29,028 | gopasspw/gopass | pkg/action/show.go | showHandleRevision | func (s *Action) showHandleRevision(ctx context.Context, c *cli.Context, name, key, revision string) error {
sec, err := s.Store.GetRevision(ctx, name, revision)
if err != nil {
return s.showHandleError(ctx, c, name, false, err)
}
return s.showHandleOutput(ctx, name, key, sec)
} | go | func (s *Action) showHandleRevision(ctx context.Context, c *cli.Context, name, key, revision string) error {
sec, err := s.Store.GetRevision(ctx, name, revision)
if err != nil {
return s.showHandleError(ctx, c, name, false, err)
}
return s.showHandleOutput(ctx, name, key, sec)
} | [
"func",
"(",
"s",
"*",
"Action",
")",
"showHandleRevision",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
",",
"name",
",",
"key",
",",
"revision",
"string",
")",
"error",
"{",
"sec",
",",
"err",
":=",
"s",
".",
"Stor... | // showHandleRevision displays a single revision | [
"showHandleRevision",
"displays",
"a",
"single",
"revision"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/show.go#L79-L86 |
29,029 | gopasspw/gopass | pkg/action/show.go | showHandleOutput | func (s *Action) showHandleOutput(ctx context.Context, name, key string, sec store.Secret) error {
var content string
switch {
case key != "":
val, err := sec.Value(key)
if err != nil {
return s.showHandleYAMLError(ctx, name, key, err)
}
if IsClip(ctx) {
return clipboard.CopyTo(ctx, name, []byte(val))... | go | func (s *Action) showHandleOutput(ctx context.Context, name, key string, sec store.Secret) error {
var content string
switch {
case key != "":
val, err := sec.Value(key)
if err != nil {
return s.showHandleYAMLError(ctx, name, key, err)
}
if IsClip(ctx) {
return clipboard.CopyTo(ctx, name, []byte(val))... | [
"func",
"(",
"s",
"*",
"Action",
")",
"showHandleOutput",
"(",
"ctx",
"context",
".",
"Context",
",",
"name",
",",
"key",
"string",
",",
"sec",
"store",
".",
"Secret",
")",
"error",
"{",
"var",
"content",
"string",
"\n\n",
"switch",
"{",
"case",
"key",... | // showHandleOutput displays a secret | [
"showHandleOutput",
"displays",
"a",
"secret"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/show.go#L89-L131 |
29,030 | gopasspw/gopass | pkg/action/show.go | showHandleError | func (s *Action) showHandleError(ctx context.Context, c *cli.Context, name string, recurse bool, err error) error {
if err != store.ErrNotFound || !recurse || !ctxutil.IsTerminal(ctx) {
return ExitError(ctx, ExitUnknown, err, "failed to retrieve secret '%s': %s", name, err)
}
out.Yellow(ctx, "Entry '%s' not found.... | go | func (s *Action) showHandleError(ctx context.Context, c *cli.Context, name string, recurse bool, err error) error {
if err != store.ErrNotFound || !recurse || !ctxutil.IsTerminal(ctx) {
return ExitError(ctx, ExitUnknown, err, "failed to retrieve secret '%s': %s", name, err)
}
out.Yellow(ctx, "Entry '%s' not found.... | [
"func",
"(",
"s",
"*",
"Action",
")",
"showHandleError",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
",",
"name",
"string",
",",
"recurse",
"bool",
",",
"err",
"error",
")",
"error",
"{",
"if",
"err",
"!=",
"store",
... | // showHandleError handles errors retrieving secrets | [
"showHandleError",
"handles",
"errors",
"retrieving",
"secrets"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/show.go#L134-L144 |
29,031 | gopasspw/gopass | pkg/updater/update.go | Update | func Update(ctx context.Context, pre bool, version semver.Version) error {
if err := IsUpdateable(ctx); err != nil {
out.Error(ctx, "Your gopass binary is externally managed. Can not update.")
out.Debug(ctx, "Error: %s", err)
return nil
}
ok, err := termio.AskForBool(ctx, "Do you want to check for available u... | go | func Update(ctx context.Context, pre bool, version semver.Version) error {
if err := IsUpdateable(ctx); err != nil {
out.Error(ctx, "Your gopass binary is externally managed. Can not update.")
out.Debug(ctx, "Error: %s", err)
return nil
}
ok, err := termio.AskForBool(ctx, "Do you want to check for available u... | [
"func",
"Update",
"(",
"ctx",
"context",
".",
"Context",
",",
"pre",
"bool",
",",
"version",
"semver",
".",
"Version",
")",
"error",
"{",
"if",
"err",
":=",
"IsUpdateable",
"(",
"ctx",
")",
";",
"err",
"!=",
"nil",
"{",
"out",
".",
"Error",
"(",
"c... | // Update will start hte interactive update assistant | [
"Update",
"will",
"start",
"hte",
"interactive",
"update",
"assistant"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/updater/update.go#L41-L89 |
29,032 | gopasspw/gopass | pkg/action/history.go | History | func (s *Action) History(ctx context.Context, c *cli.Context) error {
name := c.Args().Get(0)
showPassword := c.Bool("password")
if name == "" {
return ExitError(ctx, ExitUsage, nil, "Usage: %s history <NAME>", s.Name)
}
if !s.Store.Exists(ctx, name) {
return ExitError(ctx, ExitNotFound, nil, "Secret not fou... | go | func (s *Action) History(ctx context.Context, c *cli.Context) error {
name := c.Args().Get(0)
showPassword := c.Bool("password")
if name == "" {
return ExitError(ctx, ExitUsage, nil, "Usage: %s history <NAME>", s.Name)
}
if !s.Store.Exists(ctx, name) {
return ExitError(ctx, ExitNotFound, nil, "Secret not fou... | [
"func",
"(",
"s",
"*",
"Action",
")",
"History",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"name",
":=",
"c",
".",
"Args",
"(",
")",
".",
"Get",
"(",
"0",
")",
"\n",
"showPassword",
":=",
"c... | // History displays the history of a given secret | [
"History",
"displays",
"the",
"history",
"of",
"a",
"given",
"secret"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/history.go#L13-L44 |
29,033 | gopasspw/gopass | pkg/fsutil/fsutil.go | CleanPath | func CleanPath(path string) string {
// http://stackoverflow.com/questions/17609732/expand-tilde-to-home-directory
if len(path) > 1 && path[:2] == "~/" {
usr, _ := user.Current()
dir := usr.HomeDir
path = strings.Replace(path, "~/", dir+"/", 1)
}
if p, err := filepath.Abs(path); err == nil {
return p
}
re... | go | func CleanPath(path string) string {
// http://stackoverflow.com/questions/17609732/expand-tilde-to-home-directory
if len(path) > 1 && path[:2] == "~/" {
usr, _ := user.Current()
dir := usr.HomeDir
path = strings.Replace(path, "~/", dir+"/", 1)
}
if p, err := filepath.Abs(path); err == nil {
return p
}
re... | [
"func",
"CleanPath",
"(",
"path",
"string",
")",
"string",
"{",
"// http://stackoverflow.com/questions/17609732/expand-tilde-to-home-directory",
"if",
"len",
"(",
"path",
")",
">",
"1",
"&&",
"path",
"[",
":",
"2",
"]",
"==",
"\"",
"\"",
"{",
"usr",
",",
"_",
... | // CleanPath resolves common aliases in a path and cleans it as much as possible | [
"CleanPath",
"resolves",
"common",
"aliases",
"in",
"a",
"path",
"and",
"cleans",
"it",
"as",
"much",
"as",
"possible"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/fsutil/fsutil.go#L26-L37 |
29,034 | gopasspw/gopass | pkg/fsutil/fsutil.go | IsFile | func IsFile(path string) bool {
fi, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
// not found
return false
}
fmt.Printf("failed to check dir %s: %s\n", path, err)
return false
}
return fi.Mode().IsRegular()
} | go | func IsFile(path string) bool {
fi, err := os.Stat(path)
if err != nil {
if os.IsNotExist(err) {
// not found
return false
}
fmt.Printf("failed to check dir %s: %s\n", path, err)
return false
}
return fi.Mode().IsRegular()
} | [
"func",
"IsFile",
"(",
"path",
"string",
")",
"bool",
"{",
"fi",
",",
"err",
":=",
"os",
".",
"Stat",
"(",
"path",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"if",
"os",
".",
"IsNotExist",
"(",
"err",
")",
"{",
"// not found",
"return",
"false",
"... | // IsFile checks if a certain path is actually a file | [
"IsFile",
"checks",
"if",
"a",
"certain",
"path",
"is",
"actually",
"a",
"file"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/fsutil/fsutil.go#L56-L68 |
29,035 | gopasspw/gopass | pkg/fsutil/fsutil.go | IsEmptyDir | func IsEmptyDir(path string) (bool, error) {
empty := true
if err := filepath.Walk(path, func(fp string, fi os.FileInfo, ferr error) error {
if ferr != nil {
return ferr
}
if fi.IsDir() && (fi.Name() == "." || fi.Name() == "..") {
return filepath.SkipDir
}
if fi.Mode().IsRegular() {
empty = false
... | go | func IsEmptyDir(path string) (bool, error) {
empty := true
if err := filepath.Walk(path, func(fp string, fi os.FileInfo, ferr error) error {
if ferr != nil {
return ferr
}
if fi.IsDir() && (fi.Name() == "." || fi.Name() == "..") {
return filepath.SkipDir
}
if fi.Mode().IsRegular() {
empty = false
... | [
"func",
"IsEmptyDir",
"(",
"path",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"empty",
":=",
"true",
"\n",
"if",
"err",
":=",
"filepath",
".",
"Walk",
"(",
"path",
",",
"func",
"(",
"fp",
"string",
",",
"fi",
"os",
".",
"FileInfo",
",",
... | // IsEmptyDir checks if a certain path is an empty directory | [
"IsEmptyDir",
"checks",
"if",
"a",
"certain",
"path",
"is",
"an",
"empty",
"directory"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/fsutil/fsutil.go#L71-L88 |
29,036 | gopasspw/gopass | pkg/fsutil/fsutil.go | Shred | func Shred(path string, runs int) error {
rand.Seed(time.Now().UnixNano())
fh, err := os.OpenFile(path, os.O_WRONLY, 0600)
if err != nil {
return errors.Wrapf(err, "failed to open file '%s'", path)
}
buf := make([]byte, 1024)
for i := 0; i < runs; i++ {
// overwrite using pseudo-random data n-1 times and
//... | go | func Shred(path string, runs int) error {
rand.Seed(time.Now().UnixNano())
fh, err := os.OpenFile(path, os.O_WRONLY, 0600)
if err != nil {
return errors.Wrapf(err, "failed to open file '%s'", path)
}
buf := make([]byte, 1024)
for i := 0; i < runs; i++ {
// overwrite using pseudo-random data n-1 times and
//... | [
"func",
"Shred",
"(",
"path",
"string",
",",
"runs",
"int",
")",
"error",
"{",
"rand",
".",
"Seed",
"(",
"time",
".",
"Now",
"(",
")",
".",
"UnixNano",
"(",
")",
")",
"\n",
"fh",
",",
"err",
":=",
"os",
".",
"OpenFile",
"(",
"path",
",",
"os",
... | // Shred overwrite the given file any number of times | [
"Shred",
"overwrite",
"the",
"given",
"file",
"any",
"number",
"of",
"times"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/fsutil/fsutil.go#L91-L125 |
29,037 | gopasspw/gopass | pkg/action/copy.go | Copy | func (s *Action) Copy(ctx context.Context, c *cli.Context) error {
force := c.Bool("force")
if len(c.Args()) != 2 {
return ExitError(ctx, ExitUsage, nil, "Usage: %s cp <FROM> <TO>", s.Name)
}
from := c.Args()[0]
to := c.Args()[1]
return s.copy(ctx, from, to, force)
} | go | func (s *Action) Copy(ctx context.Context, c *cli.Context) error {
force := c.Bool("force")
if len(c.Args()) != 2 {
return ExitError(ctx, ExitUsage, nil, "Usage: %s cp <FROM> <TO>", s.Name)
}
from := c.Args()[0]
to := c.Args()[1]
return s.copy(ctx, from, to, force)
} | [
"func",
"(",
"s",
"*",
"Action",
")",
"Copy",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"cli",
".",
"Context",
")",
"error",
"{",
"force",
":=",
"c",
".",
"Bool",
"(",
"\"",
"\"",
")",
"\n\n",
"if",
"len",
"(",
"c",
".",
"Args",
"... | // Copy the contents of a file to another one | [
"Copy",
"the",
"contents",
"of",
"a",
"file",
"to",
"another",
"one"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/action/copy.go#L13-L24 |
29,038 | gopasspw/gopass | pkg/store/vault/unsupported.go | GetTemplate | func (s *Store) GetTemplate(context.Context, string) ([]byte, error) {
return nil, fmt.Errorf("not supported")
} | go | func (s *Store) GetTemplate(context.Context, string) ([]byte, error) {
return nil, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"GetTemplate",
"(",
"context",
".",
"Context",
",",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // GetTemplate is unsupported | [
"GetTemplate",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L16-L18 |
29,039 | gopasspw/gopass | pkg/store/vault/unsupported.go | LookupTemplate | func (s *Store) LookupTemplate(context.Context, string) (string, []byte, bool) {
return "", nil, false
} | go | func (s *Store) LookupTemplate(context.Context, string) (string, []byte, bool) {
return "", nil, false
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"LookupTemplate",
"(",
"context",
".",
"Context",
",",
"string",
")",
"(",
"string",
",",
"[",
"]",
"byte",
",",
"bool",
")",
"{",
"return",
"\"",
"\"",
",",
"nil",
",",
"false",
"\n",
"}"
] | // LookupTemplate is unsupported | [
"LookupTemplate",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L31-L33 |
29,040 | gopasspw/gopass | pkg/store/vault/unsupported.go | SetTemplate | func (s *Store) SetTemplate(context.Context, string, []byte) error {
return fmt.Errorf("not supported")
} | go | func (s *Store) SetTemplate(context.Context, string, []byte) error {
return fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"SetTemplate",
"(",
"context",
".",
"Context",
",",
"string",
",",
"[",
"]",
"byte",
")",
"error",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // SetTemplate is unsupported | [
"SetTemplate",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L41-L43 |
29,041 | gopasspw/gopass | pkg/store/vault/unsupported.go | TemplateTree | func (s *Store) TemplateTree(context.Context) (tree.Tree, error) {
return nil, fmt.Errorf("not supported")
} | go | func (s *Store) TemplateTree(context.Context) (tree.Tree, error) {
return nil, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"TemplateTree",
"(",
"context",
".",
"Context",
")",
"(",
"tree",
".",
"Tree",
",",
"error",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // TemplateTree is unsupported | [
"TemplateTree",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L46-L48 |
29,042 | gopasspw/gopass | pkg/store/vault/unsupported.go | GetRecipients | func (s *Store) GetRecipients(context.Context, string) ([]string, error) {
return nil, fmt.Errorf("not supported")
} | go | func (s *Store) GetRecipients(context.Context, string) ([]string, error) {
return nil, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"GetRecipients",
"(",
"context",
".",
"Context",
",",
"string",
")",
"(",
"[",
"]",
"string",
",",
"error",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // GetRecipients is unsupported | [
"GetRecipients",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L56-L58 |
29,043 | gopasspw/gopass | pkg/store/vault/unsupported.go | ExportMissingPublicKeys | func (s *Store) ExportMissingPublicKeys(context.Context, []string) (bool, error) {
return false, fmt.Errorf("not supported")
} | go | func (s *Store) ExportMissingPublicKeys(context.Context, []string) (bool, error) {
return false, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"ExportMissingPublicKeys",
"(",
"context",
".",
"Context",
",",
"[",
"]",
"string",
")",
"(",
"bool",
",",
"error",
")",
"{",
"return",
"false",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // ExportMissingPublicKeys is unsupported | [
"ExportMissingPublicKeys",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L86-L88 |
29,044 | gopasspw/gopass | pkg/store/vault/unsupported.go | GitInit | func (s *Store) GitInit(context.Context, string, string) error {
return fmt.Errorf("not supported")
} | go | func (s *Store) GitInit(context.Context, string, string) error {
return fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"GitInit",
"(",
"context",
".",
"Context",
",",
"string",
",",
"string",
")",
"error",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}"
] | // GitInit is unsupported | [
"GitInit",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L106-L108 |
29,045 | gopasspw/gopass | pkg/store/vault/unsupported.go | GetRevision | func (s *Store) GetRevision(context.Context, string, string) (store.Secret, error) {
return nil, fmt.Errorf("not supported")
} | go | func (s *Store) GetRevision(context.Context, string, string) (store.Secret, error) {
return nil, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"GetRevision",
"(",
"context",
".",
"Context",
",",
"string",
",",
"string",
")",
"(",
"store",
".",
"Secret",
",",
"error",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}... | // GetRevision is unsupported | [
"GetRevision",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L111-L113 |
29,046 | gopasspw/gopass | pkg/store/vault/unsupported.go | ListRevisions | func (s *Store) ListRevisions(context.Context, string) ([]backend.Revision, error) {
return nil, fmt.Errorf("not supported")
} | go | func (s *Store) ListRevisions(context.Context, string) ([]backend.Revision, error) {
return nil, fmt.Errorf("not supported")
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"ListRevisions",
"(",
"context",
".",
"Context",
",",
"string",
")",
"(",
"[",
"]",
"backend",
".",
"Revision",
",",
"error",
")",
"{",
"return",
"nil",
",",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"... | // ListRevisions is unsupported | [
"ListRevisions",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L116-L118 |
29,047 | gopasspw/gopass | pkg/store/vault/unsupported.go | Fsck | func (s *Store) Fsck(ctx context.Context, prefix string) error {
return nil
} | go | func (s *Store) Fsck(ctx context.Context, prefix string) error {
return nil
} | [
"func",
"(",
"s",
"*",
"Store",
")",
"Fsck",
"(",
"ctx",
"context",
".",
"Context",
",",
"prefix",
"string",
")",
"error",
"{",
"return",
"nil",
"\n",
"}"
] | // Fsck is unsupported | [
"Fsck",
"is",
"unsupported"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/store/vault/unsupported.go#L121-L123 |
29,048 | gopasspw/gopass | pkg/pwgen/pwgen.go | GeneratePassword | func GeneratePassword(length int, symbols bool) string {
chars := digits + upper + lower
if symbols {
chars += syms
}
if c := os.Getenv("GOPASS_CHARACTER_SET"); c != "" {
chars = c
}
if c := os.Getenv("GOPASS_EXTERNAL_PWGEN"); c != "" {
if pw, err := generateExternal(c); err == nil {
return pw
}
}
re... | go | func GeneratePassword(length int, symbols bool) string {
chars := digits + upper + lower
if symbols {
chars += syms
}
if c := os.Getenv("GOPASS_CHARACTER_SET"); c != "" {
chars = c
}
if c := os.Getenv("GOPASS_EXTERNAL_PWGEN"); c != "" {
if pw, err := generateExternal(c); err == nil {
return pw
}
}
re... | [
"func",
"GeneratePassword",
"(",
"length",
"int",
",",
"symbols",
"bool",
")",
"string",
"{",
"chars",
":=",
"digits",
"+",
"upper",
"+",
"lower",
"\n",
"if",
"symbols",
"{",
"chars",
"+=",
"syms",
"\n",
"}",
"\n",
"if",
"c",
":=",
"os",
".",
"Getenv... | // GeneratePassword generates a random, hard to remember password | [
"GeneratePassword",
"generates",
"a",
"random",
"hard",
"to",
"remember",
"password"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/pwgen/pwgen.go#L36-L50 |
29,049 | gopasspw/gopass | pkg/pwgen/pwgen.go | GeneratePasswordCharset | func GeneratePasswordCharset(length int, chars string) string {
pw := &bytes.Buffer{}
for pw.Len() < length {
_ = pw.WriteByte(chars[randomInteger(len(chars))])
}
return pw.String()
} | go | func GeneratePasswordCharset(length int, chars string) string {
pw := &bytes.Buffer{}
for pw.Len() < length {
_ = pw.WriteByte(chars[randomInteger(len(chars))])
}
return pw.String()
} | [
"func",
"GeneratePasswordCharset",
"(",
"length",
"int",
",",
"chars",
"string",
")",
"string",
"{",
"pw",
":=",
"&",
"bytes",
".",
"Buffer",
"{",
"}",
"\n",
"for",
"pw",
".",
"Len",
"(",
")",
"<",
"length",
"{",
"_",
"=",
"pw",
".",
"WriteByte",
"... | // GeneratePasswordCharset generates a random password from a given
// set of characters | [
"GeneratePasswordCharset",
"generates",
"a",
"random",
"password",
"from",
"a",
"given",
"set",
"of",
"characters"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/pwgen/pwgen.go#L74-L80 |
29,050 | gopasspw/gopass | pkg/pwgen/pwgen.go | GeneratePasswordCharsetCheck | func GeneratePasswordCharsetCheck(length int, chars string) string {
validator := crunchy.NewValidator()
var password string
for i := 0; i < 3; i++ {
pw := &bytes.Buffer{}
for pw.Len() < length {
_ = pw.WriteByte(chars[randomInteger(len(chars))])
}
password = pw.String()
if validator.Check(password) =... | go | func GeneratePasswordCharsetCheck(length int, chars string) string {
validator := crunchy.NewValidator()
var password string
for i := 0; i < 3; i++ {
pw := &bytes.Buffer{}
for pw.Len() < length {
_ = pw.WriteByte(chars[randomInteger(len(chars))])
}
password = pw.String()
if validator.Check(password) =... | [
"func",
"GeneratePasswordCharsetCheck",
"(",
"length",
"int",
",",
"chars",
"string",
")",
"string",
"{",
"validator",
":=",
"crunchy",
".",
"NewValidator",
"(",
")",
"\n",
"var",
"password",
"string",
"\n\n",
"for",
"i",
":=",
"0",
";",
"i",
"<",
"3",
"... | // GeneratePasswordCharsetCheck generates a random password from a given
// set of characters and validates the generated password with crunchy | [
"GeneratePasswordCharsetCheck",
"generates",
"a",
"random",
"password",
"from",
"a",
"given",
"set",
"of",
"characters",
"and",
"validates",
"the",
"generated",
"password",
"with",
"crunchy"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/pwgen/pwgen.go#L112-L129 |
29,051 | gopasspw/gopass | pkg/backend/crypto/xc/export.go | ExportPublicKey | func (x *XC) ExportPublicKey(ctx context.Context, id string) ([]byte, error) {
if x.pubring.Contains(id) {
return x.pubring.Export(id)
}
if x.secring.Contains(id) {
return x.secring.Export(id, false)
}
return nil, fmt.Errorf("key not found")
} | go | func (x *XC) ExportPublicKey(ctx context.Context, id string) ([]byte, error) {
if x.pubring.Contains(id) {
return x.pubring.Export(id)
}
if x.secring.Contains(id) {
return x.secring.Export(id, false)
}
return nil, fmt.Errorf("key not found")
} | [
"func",
"(",
"x",
"*",
"XC",
")",
"ExportPublicKey",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"if",
"x",
".",
"pubring",
".",
"Contains",
"(",
"id",
")",
"{",
"return",
"x",
... | // ExportPublicKey exports a given public key | [
"ExportPublicKey",
"exports",
"a",
"given",
"public",
"key"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/crypto/xc/export.go#L9-L17 |
29,052 | gopasspw/gopass | pkg/backend/crypto/xc/export.go | ExportPrivateKey | func (x *XC) ExportPrivateKey(ctx context.Context, id string) ([]byte, error) {
return x.secring.Export(id, true)
} | go | func (x *XC) ExportPrivateKey(ctx context.Context, id string) ([]byte, error) {
return x.secring.Export(id, true)
} | [
"func",
"(",
"x",
"*",
"XC",
")",
"ExportPrivateKey",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"string",
")",
"(",
"[",
"]",
"byte",
",",
"error",
")",
"{",
"return",
"x",
".",
"secring",
".",
"Export",
"(",
"id",
",",
"true",
")",
"\n",... | // ExportPrivateKey exports a given private key | [
"ExportPrivateKey",
"exports",
"a",
"given",
"private",
"key"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/backend/crypto/xc/export.go#L20-L22 |
29,053 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithDebug | func WithDebug(ctx context.Context, dbg bool) context.Context {
return context.WithValue(ctx, ctxKeyDebug, dbg)
} | go | func WithDebug(ctx context.Context, dbg bool) context.Context {
return context.WithValue(ctx, ctxKeyDebug, dbg)
} | [
"func",
"WithDebug",
"(",
"ctx",
"context",
".",
"Context",
",",
"dbg",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyDebug",
",",
"dbg",
")",
"\n",
"}"
] | // WithDebug returns a context with an explicit value for debug | [
"WithDebug",
"returns",
"a",
"context",
"with",
"an",
"explicit",
"value",
"for",
"debug"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L39-L41 |
29,054 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasDebug | func HasDebug(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyDebug).(bool)
return ok
} | go | func HasDebug(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyDebug).(bool)
return ok
} | [
"func",
"HasDebug",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyDebug",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasDebug returns true if a value for debug has been set in this context | [
"HasDebug",
"returns",
"true",
"if",
"a",
"value",
"for",
"debug",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L44-L47 |
29,055 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithColor | func WithColor(ctx context.Context, color bool) context.Context {
return context.WithValue(ctx, ctxKeyColor, color)
} | go | func WithColor(ctx context.Context, color bool) context.Context {
return context.WithValue(ctx, ctxKeyColor, color)
} | [
"func",
"WithColor",
"(",
"ctx",
"context",
".",
"Context",
",",
"color",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyColor",
",",
"color",
")",
"\n",
"}"
] | // WithColor returns a context with an explicit value for color | [
"WithColor",
"returns",
"a",
"context",
"with",
"an",
"explicit",
"value",
"for",
"color"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L59-L61 |
29,056 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasColor | func HasColor(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyColor).(bool)
return ok
} | go | func HasColor(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyColor).(bool)
return ok
} | [
"func",
"HasColor",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyColor",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasColor returns true if a value for Color has been set in this context | [
"HasColor",
"returns",
"true",
"if",
"a",
"value",
"for",
"Color",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L64-L67 |
29,057 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithTerminal | func WithTerminal(ctx context.Context, isTerm bool) context.Context {
return context.WithValue(ctx, ctxKeyTerminal, isTerm)
} | go | func WithTerminal(ctx context.Context, isTerm bool) context.Context {
return context.WithValue(ctx, ctxKeyTerminal, isTerm)
} | [
"func",
"WithTerminal",
"(",
"ctx",
"context",
".",
"Context",
",",
"isTerm",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyTerminal",
",",
"isTerm",
")",
"\n",
"}"
] | // WithTerminal returns a context with an explicit value for terminal | [
"WithTerminal",
"returns",
"a",
"context",
"with",
"an",
"explicit",
"value",
"for",
"terminal"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L79-L81 |
29,058 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasTerminal | func HasTerminal(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyTerminal).(bool)
return ok
} | go | func HasTerminal(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyTerminal).(bool)
return ok
} | [
"func",
"HasTerminal",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyTerminal",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasTerminal returns true if a value for Terminal has been set in this context | [
"HasTerminal",
"returns",
"true",
"if",
"a",
"value",
"for",
"Terminal",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L84-L87 |
29,059 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithInteractive | func WithInteractive(ctx context.Context, isInteractive bool) context.Context {
return context.WithValue(ctx, ctxKeyInteractive, isInteractive)
} | go | func WithInteractive(ctx context.Context, isInteractive bool) context.Context {
return context.WithValue(ctx, ctxKeyInteractive, isInteractive)
} | [
"func",
"WithInteractive",
"(",
"ctx",
"context",
".",
"Context",
",",
"isInteractive",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyInteractive",
",",
"isInteractive",
")",
"\n",
"}"
] | // WithInteractive returns a context with an explicit value for interactive | [
"WithInteractive",
"returns",
"a",
"context",
"with",
"an",
"explicit",
"value",
"for",
"interactive"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L99-L101 |
29,060 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasInteractive | func HasInteractive(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyInteractive).(bool)
return ok
} | go | func HasInteractive(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyInteractive).(bool)
return ok
} | [
"func",
"HasInteractive",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyInteractive",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasInteractive returns true if a value for Interactive has been set in this context | [
"HasInteractive",
"returns",
"true",
"if",
"a",
"value",
"for",
"Interactive",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L104-L107 |
29,061 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasStdin | func HasStdin(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyStdin).(bool)
return ok
} | go | func HasStdin(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyStdin).(bool)
return ok
} | [
"func",
"HasStdin",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyStdin",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasStdin returns true if a value for Stdin has been set in this context | [
"HasStdin",
"returns",
"true",
"if",
"a",
"value",
"for",
"Stdin",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L125-L128 |
29,062 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithAskForMore | func WithAskForMore(ctx context.Context, afm bool) context.Context {
return context.WithValue(ctx, ctxKeyAskForMore, afm)
} | go | func WithAskForMore(ctx context.Context, afm bool) context.Context {
return context.WithValue(ctx, ctxKeyAskForMore, afm)
} | [
"func",
"WithAskForMore",
"(",
"ctx",
"context",
".",
"Context",
",",
"afm",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyAskForMore",
",",
"afm",
")",
"\n",
"}"
] | // WithAskForMore returns a context with the value for ask for more set | [
"WithAskForMore",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ask",
"for",
"more",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L141-L143 |
29,063 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasAskForMore | func HasAskForMore(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAskForMore).(bool)
return ok
} | go | func HasAskForMore(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAskForMore).(bool)
return ok
} | [
"func",
"HasAskForMore",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyAskForMore",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasAskForMore returns true if a value for AskForMore has been set in this context | [
"HasAskForMore",
"returns",
"true",
"if",
"a",
"value",
"for",
"AskForMore",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L146-L149 |
29,064 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithClipTimeout | func WithClipTimeout(ctx context.Context, to int) context.Context {
return context.WithValue(ctx, ctxKeyClipTimeout, to)
} | go | func WithClipTimeout(ctx context.Context, to int) context.Context {
return context.WithValue(ctx, ctxKeyClipTimeout, to)
} | [
"func",
"WithClipTimeout",
"(",
"ctx",
"context",
".",
"Context",
",",
"to",
"int",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyClipTimeout",
",",
"to",
")",
"\n",
"}"
] | // WithClipTimeout returns a context with the value for clip timeout set | [
"WithClipTimeout",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"clip",
"timeout",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L161-L163 |
29,065 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasClipTimeout | func HasClipTimeout(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyClipTimeout).(int)
return ok
} | go | func HasClipTimeout(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyClipTimeout).(int)
return ok
} | [
"func",
"HasClipTimeout",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyClipTimeout",
")",
".",
"(",
"int",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasClipTimeout returns true if a value for ClipTimeout has been set in this context | [
"HasClipTimeout",
"returns",
"true",
"if",
"a",
"value",
"for",
"ClipTimeout",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L166-L169 |
29,066 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithNoConfirm | func WithNoConfirm(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoConfirm, bv)
} | go | func WithNoConfirm(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoConfirm, bv)
} | [
"func",
"WithNoConfirm",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyNoConfirm",
",",
"bv",
")",
"\n",
"}"
] | // WithNoConfirm returns a context with the value for ask for more set | [
"WithNoConfirm",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ask",
"for",
"more",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L181-L183 |
29,067 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasNoConfirm | func HasNoConfirm(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoConfirm).(bool)
return ok
} | go | func HasNoConfirm(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoConfirm).(bool)
return ok
} | [
"func",
"HasNoConfirm",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyNoConfirm",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasNoConfirm returns true if a value for NoConfirm has been set in this context | [
"HasNoConfirm",
"returns",
"true",
"if",
"a",
"value",
"for",
"NoConfirm",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L186-L189 |
29,068 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithNoPager | func WithNoPager(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoPager, bv)
} | go | func WithNoPager(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoPager, bv)
} | [
"func",
"WithNoPager",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyNoPager",
",",
"bv",
")",
"\n",
"}"
] | // WithNoPager returns a context with the value for ask for more set | [
"WithNoPager",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ask",
"for",
"more",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L201-L203 |
29,069 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasNoPager | func HasNoPager(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoPager).(bool)
return ok
} | go | func HasNoPager(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoPager).(bool)
return ok
} | [
"func",
"HasNoPager",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyNoPager",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasNoPager returns true if a value for NoPager has been set in this context | [
"HasNoPager",
"returns",
"true",
"if",
"a",
"value",
"for",
"NoPager",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L206-L209 |
29,070 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithShowSafeContent | func WithShowSafeContent(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyShowSafeContent, bv)
} | go | func WithShowSafeContent(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyShowSafeContent, bv)
} | [
"func",
"WithShowSafeContent",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyShowSafeContent",
",",
"bv",
")",
"\n",
"}"
] | // WithShowSafeContent returns a context with the value for ShowSafeContent set | [
"WithShowSafeContent",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ShowSafeContent",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L221-L223 |
29,071 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasShowSafeContent | func HasShowSafeContent(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyShowSafeContent).(bool)
return ok
} | go | func HasShowSafeContent(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyShowSafeContent).(bool)
return ok
} | [
"func",
"HasShowSafeContent",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyShowSafeContent",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasShowSafeContent returns true if a value for ShowSafeContent has been set in this context | [
"HasShowSafeContent",
"returns",
"true",
"if",
"a",
"value",
"for",
"ShowSafeContent",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L226-L229 |
29,072 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithGitCommit | func WithGitCommit(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyGitCommit, bv)
} | go | func WithGitCommit(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyGitCommit, bv)
} | [
"func",
"WithGitCommit",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyGitCommit",
",",
"bv",
")",
"\n",
"}"
] | // WithGitCommit returns a context with the value of git commit set | [
"WithGitCommit",
"returns",
"a",
"context",
"with",
"the",
"value",
"of",
"git",
"commit",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L241-L243 |
29,073 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasGitCommit | func HasGitCommit(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyGitCommit).(bool)
return ok
} | go | func HasGitCommit(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyGitCommit).(bool)
return ok
} | [
"func",
"HasGitCommit",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyGitCommit",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasGitCommit returns true if a value for GitCommit has been set in this context | [
"HasGitCommit",
"returns",
"true",
"if",
"a",
"value",
"for",
"GitCommit",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L246-L249 |
29,074 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithUseSymbols | func WithUseSymbols(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyUseSymbols, bv)
} | go | func WithUseSymbols(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyUseSymbols, bv)
} | [
"func",
"WithUseSymbols",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyUseSymbols",
",",
"bv",
")",
"\n",
"}"
] | // WithUseSymbols returns a context with the value for ask for more set | [
"WithUseSymbols",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ask",
"for",
"more",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L261-L263 |
29,075 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasUseSymbols | func HasUseSymbols(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyUseSymbols).(bool)
return ok
} | go | func HasUseSymbols(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyUseSymbols).(bool)
return ok
} | [
"func",
"HasUseSymbols",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyUseSymbols",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasUseSymbols returns true if a value for UseSymbols has been set in this context | [
"HasUseSymbols",
"returns",
"true",
"if",
"a",
"value",
"for",
"UseSymbols",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L266-L269 |
29,076 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithNoColor | func WithNoColor(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoColor, bv)
} | go | func WithNoColor(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyNoColor, bv)
} | [
"func",
"WithNoColor",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyNoColor",
",",
"bv",
")",
"\n",
"}"
] | // WithNoColor returns a context with the value for ask for more set | [
"WithNoColor",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"ask",
"for",
"more",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L281-L283 |
29,077 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasNoColor | func HasNoColor(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoColor).(bool)
return ok
} | go | func HasNoColor(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNoColor).(bool)
return ok
} | [
"func",
"HasNoColor",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyNoColor",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasNoColor returns true if a value for NoColor has been set in this context | [
"HasNoColor",
"returns",
"true",
"if",
"a",
"value",
"for",
"NoColor",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L286-L289 |
29,078 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithAlwaysYes | func WithAlwaysYes(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyAlwaysYes, bv)
} | go | func WithAlwaysYes(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyAlwaysYes, bv)
} | [
"func",
"WithAlwaysYes",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyAlwaysYes",
",",
"bv",
")",
"\n",
"}"
] | // WithAlwaysYes returns a context with the value of always yes set | [
"WithAlwaysYes",
"returns",
"a",
"context",
"with",
"the",
"value",
"of",
"always",
"yes",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L301-L303 |
29,079 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasAlwaysYes | func HasAlwaysYes(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAlwaysYes).(bool)
return ok
} | go | func HasAlwaysYes(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAlwaysYes).(bool)
return ok
} | [
"func",
"HasAlwaysYes",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyAlwaysYes",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasAlwaysYes returns true if a value for AlwaysYes has been set in this context | [
"HasAlwaysYes",
"returns",
"true",
"if",
"a",
"value",
"for",
"AlwaysYes",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L306-L309 |
29,080 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithFuzzySearch | func WithFuzzySearch(ctx context.Context, fuzzy bool) context.Context {
return context.WithValue(ctx, ctxKeyFuzzySearch, fuzzy)
} | go | func WithFuzzySearch(ctx context.Context, fuzzy bool) context.Context {
return context.WithValue(ctx, ctxKeyFuzzySearch, fuzzy)
} | [
"func",
"WithFuzzySearch",
"(",
"ctx",
"context",
".",
"Context",
",",
"fuzzy",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyFuzzySearch",
",",
"fuzzy",
")",
"\n",
"}"
] | // WithFuzzySearch returns a context with the value for fuzzy search set | [
"WithFuzzySearch",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"fuzzy",
"search",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L321-L323 |
29,081 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasFuzzySearch | func HasFuzzySearch(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyFuzzySearch).(bool)
return ok
} | go | func HasFuzzySearch(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyFuzzySearch).(bool)
return ok
} | [
"func",
"HasFuzzySearch",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyFuzzySearch",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasFuzzySearch returns true if a value for FuzzySearch has been set in this context | [
"HasFuzzySearch",
"returns",
"true",
"if",
"a",
"value",
"for",
"FuzzySearch",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L326-L329 |
29,082 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithVerbose | func WithVerbose(ctx context.Context, verbose bool) context.Context {
return context.WithValue(ctx, ctxKeyVerbose, verbose)
} | go | func WithVerbose(ctx context.Context, verbose bool) context.Context {
return context.WithValue(ctx, ctxKeyVerbose, verbose)
} | [
"func",
"WithVerbose",
"(",
"ctx",
"context",
".",
"Context",
",",
"verbose",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyVerbose",
",",
"verbose",
")",
"\n",
"}"
] | // WithVerbose returns a context with the value for verbose set | [
"WithVerbose",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"verbose",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L341-L343 |
29,083 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasVerbose | func HasVerbose(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyVerbose).(bool)
return ok
} | go | func HasVerbose(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyVerbose).(bool)
return ok
} | [
"func",
"HasVerbose",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyVerbose",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasVerbose returns true if a value for Verbose has been set in this context | [
"HasVerbose",
"returns",
"true",
"if",
"a",
"value",
"for",
"Verbose",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L346-L349 |
29,084 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithNotifications | func WithNotifications(ctx context.Context, verbose bool) context.Context {
return context.WithValue(ctx, ctxKeyNotifications, verbose)
} | go | func WithNotifications(ctx context.Context, verbose bool) context.Context {
return context.WithValue(ctx, ctxKeyNotifications, verbose)
} | [
"func",
"WithNotifications",
"(",
"ctx",
"context",
".",
"Context",
",",
"verbose",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyNotifications",
",",
"verbose",
")",
"\n",
"}"
] | // WithNotifications returns a context with the value for Notifications set | [
"WithNotifications",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"Notifications",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L361-L363 |
29,085 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasNotifications | func HasNotifications(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNotifications).(bool)
return ok
} | go | func HasNotifications(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyNotifications).(bool)
return ok
} | [
"func",
"HasNotifications",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyNotifications",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasNotifications returns true if a value for Notifications has been set in this context | [
"HasNotifications",
"returns",
"true",
"if",
"a",
"value",
"for",
"Notifications",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L366-L369 |
29,086 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithAutoClip | func WithAutoClip(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyAutoClip, bv)
} | go | func WithAutoClip(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyAutoClip, bv)
} | [
"func",
"WithAutoClip",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyAutoClip",
",",
"bv",
")",
"\n",
"}"
] | // WithAutoClip returns a context with the value for AutoClip set | [
"WithAutoClip",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"AutoClip",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L381-L383 |
29,087 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasAutoClip | func HasAutoClip(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAutoClip).(bool)
return ok
} | go | func HasAutoClip(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAutoClip).(bool)
return ok
} | [
"func",
"HasAutoClip",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyAutoClip",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasAutoClip returns true if a value for AutoClip has been set in this context | [
"HasAutoClip",
"returns",
"true",
"if",
"a",
"value",
"for",
"AutoClip",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L386-L389 |
29,088 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithEditRecipients | func WithEditRecipients(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyEditRecipients, bv)
} | go | func WithEditRecipients(ctx context.Context, bv bool) context.Context {
return context.WithValue(ctx, ctxKeyEditRecipients, bv)
} | [
"func",
"WithEditRecipients",
"(",
"ctx",
"context",
".",
"Context",
",",
"bv",
"bool",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyEditRecipients",
",",
"bv",
")",
"\n",
"}"
] | // WithEditRecipients returns a context with the value for EditRecipients set | [
"WithEditRecipients",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"EditRecipients",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L401-L403 |
29,089 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasEditRecipients | func HasEditRecipients(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyEditRecipients).(bool)
return ok
} | go | func HasEditRecipients(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyEditRecipients).(bool)
return ok
} | [
"func",
"HasEditRecipients",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyEditRecipients",
")",
".",
"(",
"bool",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasEditRecipients returns true if a value for EditRecipients has been set in this context | [
"HasEditRecipients",
"returns",
"true",
"if",
"a",
"value",
"for",
"EditRecipients",
"has",
"been",
"set",
"in",
"this",
"context"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L406-L409 |
29,090 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithConcurrency | func WithConcurrency(ctx context.Context, to int) context.Context {
return context.WithValue(ctx, ctxKeyConcurrency, to)
} | go | func WithConcurrency(ctx context.Context, to int) context.Context {
return context.WithValue(ctx, ctxKeyConcurrency, to)
} | [
"func",
"WithConcurrency",
"(",
"ctx",
"context",
".",
"Context",
",",
"to",
"int",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyConcurrency",
",",
"to",
")",
"\n",
"}"
] | // WithConcurrency returns a context with the value for clip timeout set | [
"WithConcurrency",
"returns",
"a",
"context",
"with",
"the",
"value",
"for",
"clip",
"timeout",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L421-L423 |
29,091 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasConcurrency | func HasConcurrency(ctx context.Context) bool {
iv, ok := ctx.Value(ctxKeyConcurrency).(int)
if iv <= 1 {
return false
}
return ok
} | go | func HasConcurrency(ctx context.Context) bool {
iv, ok := ctx.Value(ctxKeyConcurrency).(int)
if iv <= 1 {
return false
}
return ok
} | [
"func",
"HasConcurrency",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"iv",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyConcurrency",
")",
".",
"(",
"int",
")",
"\n",
"if",
"iv",
"<=",
"1",
"{",
"return",
"false",
"\n",
"}",
"\n"... | // HasConcurrency returns true if a value for Concurrency has been set in this context and is bigger than 1
// since if it is equal to 1, we are not working concurrently. | [
"HasConcurrency",
"returns",
"true",
"if",
"a",
"value",
"for",
"Concurrency",
"has",
"been",
"set",
"in",
"this",
"context",
"and",
"is",
"bigger",
"than",
"1",
"since",
"if",
"it",
"is",
"equal",
"to",
"1",
"we",
"are",
"not",
"working",
"concurrently",
... | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L427-L433 |
29,092 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithProgressCallback | func WithProgressCallback(ctx context.Context, cb ProgressCallback) context.Context {
return context.WithValue(ctx, ctxKeyProgressCallback, cb)
} | go | func WithProgressCallback(ctx context.Context, cb ProgressCallback) context.Context {
return context.WithValue(ctx, ctxKeyProgressCallback, cb)
} | [
"func",
"WithProgressCallback",
"(",
"ctx",
"context",
".",
"Context",
",",
"cb",
"ProgressCallback",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyProgressCallback",
",",
"cb",
")",
"\n",
"}"
] | // WithProgressCallback returns a context with the value of ProgressCallback set | [
"WithProgressCallback",
"returns",
"a",
"context",
"with",
"the",
"value",
"of",
"ProgressCallback",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L445-L447 |
29,093 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasProgressCallback | func HasProgressCallback(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyProgressCallback).(ProgressCallback)
return ok
} | go | func HasProgressCallback(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyProgressCallback).(ProgressCallback)
return ok
} | [
"func",
"HasProgressCallback",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyProgressCallback",
")",
".",
"(",
"ProgressCallback",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasProgressCallback returns true if a ProgressCallback has been set | [
"HasProgressCallback",
"returns",
"true",
"if",
"a",
"ProgressCallback",
"has",
"been",
"set"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L450-L453 |
29,094 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | GetProgressCallback | func GetProgressCallback(ctx context.Context) ProgressCallback {
cb, ok := ctx.Value(ctxKeyProgressCallback).(ProgressCallback)
if !ok || cb == nil {
return func() {}
}
return cb
} | go | func GetProgressCallback(ctx context.Context) ProgressCallback {
cb, ok := ctx.Value(ctxKeyProgressCallback).(ProgressCallback)
if !ok || cb == nil {
return func() {}
}
return cb
} | [
"func",
"GetProgressCallback",
"(",
"ctx",
"context",
".",
"Context",
")",
"ProgressCallback",
"{",
"cb",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyProgressCallback",
")",
".",
"(",
"ProgressCallback",
")",
"\n",
"if",
"!",
"ok",
"||",
"cb",
"==",
... | // GetProgressCallback return the set progress callback or a default one.
// It never returns nil | [
"GetProgressCallback",
"return",
"the",
"set",
"progress",
"callback",
"or",
"a",
"default",
"one",
".",
"It",
"never",
"returns",
"nil"
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L457-L463 |
29,095 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithConfigDir | func WithConfigDir(ctx context.Context, cfgdir string) context.Context {
return context.WithValue(ctx, ctxKeyConfigDir, cfgdir)
} | go | func WithConfigDir(ctx context.Context, cfgdir string) context.Context {
return context.WithValue(ctx, ctxKeyConfigDir, cfgdir)
} | [
"func",
"WithConfigDir",
"(",
"ctx",
"context",
".",
"Context",
",",
"cfgdir",
"string",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyConfigDir",
",",
"cfgdir",
")",
"\n",
"}"
] | // WithConfigDir returns a context with the config dir set. | [
"WithConfigDir",
"returns",
"a",
"context",
"with",
"the",
"config",
"dir",
"set",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L466-L468 |
29,096 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasConfigDir | func HasConfigDir(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyConfigDir).(string)
return ok
} | go | func HasConfigDir(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyConfigDir).(string)
return ok
} | [
"func",
"HasConfigDir",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyConfigDir",
")",
".",
"(",
"string",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasConfigDir returns true if a config dir has been set. | [
"HasConfigDir",
"returns",
"true",
"if",
"a",
"config",
"dir",
"has",
"been",
"set",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L471-L474 |
29,097 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | GetConfigDir | func GetConfigDir(ctx context.Context) string {
cd, ok := ctx.Value(ctxKeyConfigDir).(string)
if !ok {
return ""
}
return cd
} | go | func GetConfigDir(ctx context.Context) string {
cd, ok := ctx.Value(ctxKeyConfigDir).(string)
if !ok {
return ""
}
return cd
} | [
"func",
"GetConfigDir",
"(",
"ctx",
"context",
".",
"Context",
")",
"string",
"{",
"cd",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyConfigDir",
")",
".",
"(",
"string",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\"",
"\"",
"\n",
"}",
"\n",
... | // GetConfigDir returns the config dir if set or an empty string. | [
"GetConfigDir",
"returns",
"the",
"config",
"dir",
"if",
"set",
"or",
"an",
"empty",
"string",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L477-L483 |
29,098 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | WithAlias | func WithAlias(ctx context.Context, alias string) context.Context {
return context.WithValue(ctx, ctxKeyAlias, alias)
} | go | func WithAlias(ctx context.Context, alias string) context.Context {
return context.WithValue(ctx, ctxKeyAlias, alias)
} | [
"func",
"WithAlias",
"(",
"ctx",
"context",
".",
"Context",
",",
"alias",
"string",
")",
"context",
".",
"Context",
"{",
"return",
"context",
".",
"WithValue",
"(",
"ctx",
",",
"ctxKeyAlias",
",",
"alias",
")",
"\n",
"}"
] | // WithAlias returns an context with the alias set. | [
"WithAlias",
"returns",
"an",
"context",
"with",
"the",
"alias",
"set",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L486-L488 |
29,099 | gopasspw/gopass | pkg/ctxutil/ctxutil.go | HasAlias | func HasAlias(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAlias).(string)
return ok
} | go | func HasAlias(ctx context.Context) bool {
_, ok := ctx.Value(ctxKeyAlias).(string)
return ok
} | [
"func",
"HasAlias",
"(",
"ctx",
"context",
".",
"Context",
")",
"bool",
"{",
"_",
",",
"ok",
":=",
"ctx",
".",
"Value",
"(",
"ctxKeyAlias",
")",
".",
"(",
"string",
")",
"\n",
"return",
"ok",
"\n",
"}"
] | // HasAlias returns true if a value for alias has been set. | [
"HasAlias",
"returns",
"true",
"if",
"a",
"value",
"for",
"alias",
"has",
"been",
"set",
"."
] | fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4 | https://github.com/gopasspw/gopass/blob/fe4e21d62182f0f2e4ef9a0ca8168d849dc52bd4/pkg/ctxutil/ctxutil.go#L491-L494 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.