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
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
159,800
docker/cli
cli/command/stack/remove.go
RunRemove
func RunRemove(dockerCli command.Cli, flags *pflag.FlagSet, commonOrchestrator command.Orchestrator, opts options.Remove) error { return runOrchestratedCommand(dockerCli, flags, commonOrchestrator, func() error { return swarm.RunRemove(dockerCli, opts) }, func(kli *kubernetes.KubeCli) error { return kubernetes.Run...
go
func RunRemove(dockerCli command.Cli, flags *pflag.FlagSet, commonOrchestrator command.Orchestrator, opts options.Remove) error { return runOrchestratedCommand(dockerCli, flags, commonOrchestrator, func() error { return swarm.RunRemove(dockerCli, opts) }, func(kli *kubernetes.KubeCli) error { return kubernetes.Run...
[ "func", "RunRemove", "(", "dockerCli", "command", ".", "Cli", ",", "flags", "*", "pflag", ".", "FlagSet", ",", "commonOrchestrator", "command", ".", "Orchestrator", ",", "opts", "options", ".", "Remove", ")", "error", "{", "return", "runOrchestratedCommand", "...
// RunRemove performs a stack remove against the specified orchestrator
[ "RunRemove", "performs", "a", "stack", "remove", "against", "the", "specified", "orchestrator" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/remove.go#L35-L39
159,801
docker/cli
cli/command/image/save.go
NewSaveCommand
func NewSaveCommand(dockerCli command.Cli) *cobra.Command { var opts saveOptions cmd := &cobra.Command{ Use: "save [OPTIONS] IMAGE [IMAGE...]", Short: "Save one or more images to a tar archive (streamed to STDOUT by default)", Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) err...
go
func NewSaveCommand(dockerCli command.Cli) *cobra.Command { var opts saveOptions cmd := &cobra.Command{ Use: "save [OPTIONS] IMAGE [IMAGE...]", Short: "Save one or more images to a tar archive (streamed to STDOUT by default)", Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) err...
[ "func", "NewSaveCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "saveOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",...
// NewSaveCommand creates a new `docker save` command
[ "NewSaveCommand", "creates", "a", "new", "docker", "save", "command" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/image/save.go#L19-L37
159,802
docker/cli
cli/command/image/save.go
RunSave
func RunSave(dockerCli command.Cli, opts saveOptions) error { if opts.output == "" && dockerCli.Out().IsTerminal() { return errors.New("cowardly refusing to save to a terminal. Use the -o flag or redirect") } if err := command.ValidateOutputPath(opts.output); err != nil { return errors.Wrap(err, "failed to save...
go
func RunSave(dockerCli command.Cli, opts saveOptions) error { if opts.output == "" && dockerCli.Out().IsTerminal() { return errors.New("cowardly refusing to save to a terminal. Use the -o flag or redirect") } if err := command.ValidateOutputPath(opts.output); err != nil { return errors.Wrap(err, "failed to save...
[ "func", "RunSave", "(", "dockerCli", "command", ".", "Cli", ",", "opts", "saveOptions", ")", "error", "{", "if", "opts", ".", "output", "==", "\"", "\"", "&&", "dockerCli", ".", "Out", "(", ")", ".", "IsTerminal", "(", ")", "{", "return", "errors", "...
// RunSave performs a save against the engine based on the specified options
[ "RunSave", "performs", "a", "save", "against", "the", "engine", "based", "on", "the", "specified", "options" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/image/save.go#L40-L61
159,803
docker/cli
cmd/docker/docker.go
findCommand
func findCommand(cmd *cobra.Command, commands []string) bool { if cmd == nil { return false } for _, c := range commands { if c == cmd.Name() { return true } } return findCommand(cmd.Parent(), commands) }
go
func findCommand(cmd *cobra.Command, commands []string) bool { if cmd == nil { return false } for _, c := range commands { if c == cmd.Name() { return true } } return findCommand(cmd.Parent(), commands) }
[ "func", "findCommand", "(", "cmd", "*", "cobra", ".", "Command", ",", "commands", "[", "]", "string", ")", "bool", "{", "if", "cmd", "==", "nil", "{", "return", "false", "\n", "}", "\n", "for", "_", ",", "c", ":=", "range", "commands", "{", "if", ...
// Checks if a command or one of its ancestors is in the list
[ "Checks", "if", "a", "command", "or", "one", "of", "its", "ancestors", "is", "in", "the", "list" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cmd/docker/docker.go#L371-L381
159,804
docker/cli
cmd/docker/docker.go
hasTags
func hasTags(cmd *cobra.Command) bool { for curr := cmd; curr != nil; curr = curr.Parent() { if len(curr.Annotations) > 0 { return true } } return false }
go
func hasTags(cmd *cobra.Command) bool { for curr := cmd; curr != nil; curr = curr.Parent() { if len(curr.Annotations) > 0 { return true } } return false }
[ "func", "hasTags", "(", "cmd", "*", "cobra", ".", "Command", ")", "bool", "{", "for", "curr", ":=", "cmd", ";", "curr", "!=", "nil", ";", "curr", "=", "curr", ".", "Parent", "(", ")", "{", "if", "len", "(", "curr", ".", "Annotations", ")", ">", ...
// hasTags return true if any of the command's parents has tags
[ "hasTags", "return", "true", "if", "any", "of", "the", "command", "s", "parents", "has", "tags" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cmd/docker/docker.go#L470-L478
159,805
docker/cli
docs/yaml/generate.go
visitAll
func visitAll(root *cobra.Command, fn func(*cobra.Command)) { for _, cmd := range root.Commands() { visitAll(cmd, fn) } fn(root) }
go
func visitAll(root *cobra.Command, fn func(*cobra.Command)) { for _, cmd := range root.Commands() { visitAll(cmd, fn) } fn(root) }
[ "func", "visitAll", "(", "root", "*", "cobra", ".", "Command", ",", "fn", "func", "(", "*", "cobra", ".", "Command", ")", ")", "{", "for", "_", ",", "cmd", ":=", "range", "root", ".", "Commands", "(", ")", "{", "visitAll", "(", "cmd", ",", "fn", ...
// visitAll will traverse all commands from the root. // This is different from the VisitAll of cobra.Command where only parents // are checked.
[ "visitAll", "will", "traverse", "all", "commands", "from", "the", "root", ".", "This", "is", "different", "from", "the", "VisitAll", "of", "cobra", ".", "Command", "where", "only", "parents", "are", "checked", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/docs/yaml/generate.go#L46-L51
159,806
docker/cli
cli/command/container/start.go
NewStartCommand
func NewStartCommand(dockerCli command.Cli) *cobra.Command { var opts startOptions cmd := &cobra.Command{ Use: "start [OPTIONS] CONTAINER [CONTAINER...]", Short: "Start one or more stopped containers", Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.containers =...
go
func NewStartCommand(dockerCli command.Cli) *cobra.Command { var opts startOptions cmd := &cobra.Command{ Use: "start [OPTIONS] CONTAINER [CONTAINER...]", Short: "Start one or more stopped containers", Args: cli.RequiresMinArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.containers =...
[ "func", "NewStartCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "startOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ...
// NewStartCommand creates a new cobra.Command for `docker start`
[ "NewStartCommand", "creates", "a", "new", "cobra", ".", "Command", "for", "docker", "start" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/container/start.go#L30-L55
159,807
docker/cli
cli/compose/template/template.go
SubstituteWith
func SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, subsFuncs ...SubstituteFunc) (string, error) { var err error result := pattern.ReplaceAllStringFunc(template, func(substring string) string { matches := pattern.FindStringSubmatch(substring) groups := matchGroups(matches, pattern) if ...
go
func SubstituteWith(template string, mapping Mapping, pattern *regexp.Regexp, subsFuncs ...SubstituteFunc) (string, error) { var err error result := pattern.ReplaceAllStringFunc(template, func(substring string) string { matches := pattern.FindStringSubmatch(substring) groups := matchGroups(matches, pattern) if ...
[ "func", "SubstituteWith", "(", "template", "string", ",", "mapping", "Mapping", ",", "pattern", "*", "regexp", ".", "Regexp", ",", "subsFuncs", "...", "SubstituteFunc", ")", "(", "string", ",", "error", ")", "{", "var", "err", "error", "\n", "result", ":="...
// SubstituteWith subsitute variables in the string with their values. // It accepts additional substitute function.
[ "SubstituteWith", "subsitute", "variables", "in", "the", "string", "with", "their", "values", ".", "It", "accepts", "additional", "substitute", "function", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/template/template.go#L50-L89
159,808
docker/cli
cli/compose/template/template.go
Substitute
func Substitute(template string, mapping Mapping) (string, error) { return SubstituteWith(template, mapping, defaultPattern, DefaultSubstituteFuncs...) }
go
func Substitute(template string, mapping Mapping) (string, error) { return SubstituteWith(template, mapping, defaultPattern, DefaultSubstituteFuncs...) }
[ "func", "Substitute", "(", "template", "string", ",", "mapping", "Mapping", ")", "(", "string", ",", "error", ")", "{", "return", "SubstituteWith", "(", "template", ",", "mapping", ",", "defaultPattern", ",", "DefaultSubstituteFuncs", "...", ")", "\n", "}" ]
// Substitute variables in the string with their values
[ "Substitute", "variables", "in", "the", "string", "with", "their", "values" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/template/template.go#L92-L94
159,809
docker/cli
cli/command/trust/common.go
lookupTrustInfo
func lookupTrustInfo(cli command.Cli, remote string) ([]trustTagRow, []client.RoleWithSignatures, []data.Role, error) { ctx := context.Background() imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, image.AuthResolver(cli), remote) if err != nil { return []trustTagRow{}, []client.RoleWithSignatures{},...
go
func lookupTrustInfo(cli command.Cli, remote string) ([]trustTagRow, []client.RoleWithSignatures, []data.Role, error) { ctx := context.Background() imgRefAndAuth, err := trust.GetImageReferencesAndAuth(ctx, nil, image.AuthResolver(cli), remote) if err != nil { return []trustTagRow{}, []client.RoleWithSignatures{},...
[ "func", "lookupTrustInfo", "(", "cli", "command", ".", "Cli", ",", "remote", "string", ")", "(", "[", "]", "trustTagRow", ",", "[", "]", "client", ".", "RoleWithSignatures", ",", "[", "]", "data", ".", "Role", ",", "error", ")", "{", "ctx", ":=", "co...
// lookupTrustInfo returns processed signature and role information about a notary repository. // This information is to be pretty printed or serialized into a machine-readable format.
[ "lookupTrustInfo", "returns", "processed", "signature", "and", "role", "information", "about", "a", "notary", "repository", ".", "This", "information", "is", "to", "be", "pretty", "printed", "or", "serialized", "into", "a", "machine", "-", "readable", "format", ...
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/trust/common.go#L54-L95
159,810
docker/cli
opts/hosts.go
ParseHost
func ParseHost(defaultToTLS bool, val string) (string, error) { host := strings.TrimSpace(val) if host == "" { if defaultToTLS { host = DefaultTLSHost } else { host = DefaultHost } } else { var err error host, err = parseDockerDaemonHost(host) if err != nil { return val, err } } return host,...
go
func ParseHost(defaultToTLS bool, val string) (string, error) { host := strings.TrimSpace(val) if host == "" { if defaultToTLS { host = DefaultTLSHost } else { host = DefaultHost } } else { var err error host, err = parseDockerDaemonHost(host) if err != nil { return val, err } } return host,...
[ "func", "ParseHost", "(", "defaultToTLS", "bool", ",", "val", "string", ")", "(", "string", ",", "error", ")", "{", "host", ":=", "strings", ".", "TrimSpace", "(", "val", ")", "\n", "if", "host", "==", "\"", "\"", "{", "if", "defaultToTLS", "{", "hos...
// ParseHost and set defaults for a Daemon host string
[ "ParseHost", "and", "set", "defaults", "for", "a", "Daemon", "host", "string" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/opts/hosts.go#L45-L61
159,811
docker/cli
cli/command/cli.go
ShowHelp
func ShowHelp(err io.Writer) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { cmd.SetOutput(err) cmd.HelpFunc()(cmd, args) return nil } }
go
func ShowHelp(err io.Writer) func(*cobra.Command, []string) error { return func(cmd *cobra.Command, args []string) error { cmd.SetOutput(err) cmd.HelpFunc()(cmd, args) return nil } }
[ "func", "ShowHelp", "(", "err", "io", ".", "Writer", ")", "func", "(", "*", "cobra", ".", "Command", ",", "[", "]", "string", ")", "error", "{", "return", "func", "(", "cmd", "*", "cobra", ".", "Command", ",", "args", "[", "]", "string", ")", "er...
// ShowHelp shows the command help.
[ "ShowHelp", "shows", "the", "command", "help", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L120-L126
159,812
docker/cli
cli/command/cli.go
BuildKitEnabled
func BuildKitEnabled(si ServerInfo) (bool, error) { buildkitEnabled := si.BuildkitVersion == types.BuilderBuildKit if buildkitEnv := os.Getenv("DOCKER_BUILDKIT"); buildkitEnv != "" { var err error buildkitEnabled, err = strconv.ParseBool(buildkitEnv) if err != nil { return false, errors.Wrap(err, "DOCKER_BUI...
go
func BuildKitEnabled(si ServerInfo) (bool, error) { buildkitEnabled := si.BuildkitVersion == types.BuilderBuildKit if buildkitEnv := os.Getenv("DOCKER_BUILDKIT"); buildkitEnv != "" { var err error buildkitEnabled, err = strconv.ParseBool(buildkitEnv) if err != nil { return false, errors.Wrap(err, "DOCKER_BUI...
[ "func", "BuildKitEnabled", "(", "si", "ServerInfo", ")", "(", "bool", ",", "error", ")", "{", "buildkitEnabled", ":=", "si", ".", "BuildkitVersion", "==", "types", ".", "BuilderBuildKit", "\n", "if", "buildkitEnv", ":=", "os", ".", "Getenv", "(", "\"", "\"...
// BuildKitEnabled returns whether buildkit is enabled either through a daemon setting // or otherwise the client-side DOCKER_BUILDKIT environment variable
[ "BuildKitEnabled", "returns", "whether", "buildkit", "is", "enabled", "either", "through", "a", "daemon", "setting", "or", "otherwise", "the", "client", "-", "side", "DOCKER_BUILDKIT", "environment", "variable" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L152-L162
159,813
docker/cli
cli/command/cli.go
ManifestStore
func (cli *DockerCli) ManifestStore() manifeststore.Store { // TODO: support override default location from config file return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests")) }
go
func (cli *DockerCli) ManifestStore() manifeststore.Store { // TODO: support override default location from config file return manifeststore.NewStore(filepath.Join(config.Dir(), "manifests")) }
[ "func", "(", "cli", "*", "DockerCli", ")", "ManifestStore", "(", ")", "manifeststore", ".", "Store", "{", "// TODO: support override default location from config file", "return", "manifeststore", ".", "NewStore", "(", "filepath", ".", "Join", "(", "config", ".", "Di...
// ManifestStore returns a store for local manifests
[ "ManifestStore", "returns", "a", "store", "for", "local", "manifests" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L165-L168
159,814
docker/cli
cli/command/cli.go
RegistryClient
func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient { resolver := func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig { return ResolveAuthConfig(ctx, cli, index) } return registryclient.NewRegistryClient(resolver, UserAgent(), allowInsecure) }
go
func (cli *DockerCli) RegistryClient(allowInsecure bool) registryclient.RegistryClient { resolver := func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig { return ResolveAuthConfig(ctx, cli, index) } return registryclient.NewRegistryClient(resolver, UserAgent(), allowInsecure) }
[ "func", "(", "cli", "*", "DockerCli", ")", "RegistryClient", "(", "allowInsecure", "bool", ")", "registryclient", ".", "RegistryClient", "{", "resolver", ":=", "func", "(", "ctx", "context", ".", "Context", ",", "index", "*", "registrytypes", ".", "IndexInfo",...
// RegistryClient returns a client for communicating with a Docker distribution // registry
[ "RegistryClient", "returns", "a", "client", "for", "communicating", "with", "a", "Docker", "distribution", "registry" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L172-L177
159,815
docker/cli
cli/command/cli.go
WithInitializeClient
func WithInitializeClient(makeClient func(dockerCli *DockerCli) (client.APIClient, error)) InitializeOpt { return func(dockerCli *DockerCli) error { var err error dockerCli.client, err = makeClient(dockerCli) return err } }
go
func WithInitializeClient(makeClient func(dockerCli *DockerCli) (client.APIClient, error)) InitializeOpt { return func(dockerCli *DockerCli) error { var err error dockerCli.client, err = makeClient(dockerCli) return err } }
[ "func", "WithInitializeClient", "(", "makeClient", "func", "(", "dockerCli", "*", "DockerCli", ")", "(", "client", ".", "APIClient", ",", "error", ")", ")", "InitializeOpt", "{", "return", "func", "(", "dockerCli", "*", "DockerCli", ")", "error", "{", "var",...
// WithInitializeClient is passed to DockerCli.Initialize by callers who wish to set a particular API Client for use by the CLI.
[ "WithInitializeClient", "is", "passed", "to", "DockerCli", ".", "Initialize", "by", "callers", "who", "wish", "to", "set", "a", "particular", "API", "Client", "for", "use", "by", "the", "CLI", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L183-L189
159,816
docker/cli
cli/command/cli.go
Initialize
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...InitializeOpt) error { var err error for _, o := range ops { if err := o(cli); err != nil { return err } } cliflags.SetLogLevel(opts.Common.LogLevel) if opts.ConfigDir != "" { cliconfig.SetDir(opts.ConfigDir) } if opts.Common.Debug...
go
func (cli *DockerCli) Initialize(opts *cliflags.ClientOptions, ops ...InitializeOpt) error { var err error for _, o := range ops { if err := o(cli); err != nil { return err } } cliflags.SetLogLevel(opts.Common.LogLevel) if opts.ConfigDir != "" { cliconfig.SetDir(opts.ConfigDir) } if opts.Common.Debug...
[ "func", "(", "cli", "*", "DockerCli", ")", "Initialize", "(", "opts", "*", "cliflags", ".", "ClientOptions", ",", "ops", "...", "InitializeOpt", ")", "error", "{", "var", "err", "error", "\n\n", "for", "_", ",", "o", ":=", "range", "ops", "{", "if", ...
// Initialize the dockerCli runs initialization that must happen after command // line flags are parsed.
[ "Initialize", "the", "dockerCli", "runs", "initialization", "that", "must", "happen", "after", "command", "line", "flags", "are", "parsed", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L193-L258
159,817
docker/cli
cli/command/cli.go
NewAPIClientFromFlags
func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) { store := &ContextStoreWithDefault{ Store: store.New(cliconfig.ContextStoreDir(), defaultContextStoreConfig()), Resolver: func() (*DefaultContext, error) { return resolveDefaultContext(opts, co...
go
func NewAPIClientFromFlags(opts *cliflags.CommonOptions, configFile *configfile.ConfigFile) (client.APIClient, error) { store := &ContextStoreWithDefault{ Store: store.New(cliconfig.ContextStoreDir(), defaultContextStoreConfig()), Resolver: func() (*DefaultContext, error) { return resolveDefaultContext(opts, co...
[ "func", "NewAPIClientFromFlags", "(", "opts", "*", "cliflags", ".", "CommonOptions", ",", "configFile", "*", "configfile", ".", "ConfigFile", ")", "(", "client", ".", "APIClient", ",", "error", ")", "{", "store", ":=", "&", "ContextStoreWithDefault", "{", "Sto...
// NewAPIClientFromFlags creates a new APIClient from command line flags
[ "NewAPIClientFromFlags", "creates", "a", "new", "APIClient", "from", "command", "line", "flags" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L261-L277
159,818
docker/cli
cli/command/cli.go
NotaryClient
func (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) { return trust.GetNotaryRepository(cli.In(), cli.Out(), UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), actions...) }
go
func (cli *DockerCli) NotaryClient(imgRefAndAuth trust.ImageRefAndAuth, actions []string) (notaryclient.Repository, error) { return trust.GetNotaryRepository(cli.In(), cli.Out(), UserAgent(), imgRefAndAuth.RepoInfo(), imgRefAndAuth.AuthConfig(), actions...) }
[ "func", "(", "cli", "*", "DockerCli", ")", "NotaryClient", "(", "imgRefAndAuth", "trust", ".", "ImageRefAndAuth", ",", "actions", "[", "]", "string", ")", "(", "notaryclient", ".", "Repository", ",", "error", ")", "{", "return", "trust", ".", "GetNotaryRepos...
// NotaryClient provides a Notary Repository to interact with signed metadata for an image
[ "NotaryClient", "provides", "a", "Notary", "Repository", "to", "interact", "with", "signed", "metadata", "for", "an", "image" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L380-L382
159,819
docker/cli
cli/command/cli.go
NewContainerizedEngineClient
func (cli *DockerCli) NewContainerizedEngineClient(sockPath string) (clitypes.ContainerizedClient, error) { return cli.newContainerizeClient(sockPath) }
go
func (cli *DockerCli) NewContainerizedEngineClient(sockPath string) (clitypes.ContainerizedClient, error) { return cli.newContainerizeClient(sockPath) }
[ "func", "(", "cli", "*", "DockerCli", ")", "NewContainerizedEngineClient", "(", "sockPath", "string", ")", "(", "clitypes", ".", "ContainerizedClient", ",", "error", ")", "{", "return", "cli", ".", "newContainerizeClient", "(", "sockPath", ")", "\n", "}" ]
// NewContainerizedEngineClient returns a containerized engine client
[ "NewContainerizedEngineClient", "returns", "a", "containerized", "engine", "client" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L385-L387
159,820
docker/cli
cli/command/cli.go
StackOrchestrator
func (cli *DockerCli) StackOrchestrator(flagValue string) (Orchestrator, error) { currentContext := cli.CurrentContext() ctxRaw, err := cli.ContextStore().GetMetadata(currentContext) if store.IsErrContextDoesNotExist(err) { // case where the currentContext has been removed (CLI behavior is to fallback to using DOC...
go
func (cli *DockerCli) StackOrchestrator(flagValue string) (Orchestrator, error) { currentContext := cli.CurrentContext() ctxRaw, err := cli.ContextStore().GetMetadata(currentContext) if store.IsErrContextDoesNotExist(err) { // case where the currentContext has been removed (CLI behavior is to fallback to using DOC...
[ "func", "(", "cli", "*", "DockerCli", ")", "StackOrchestrator", "(", "flagValue", "string", ")", "(", "Orchestrator", ",", "error", ")", "{", "currentContext", ":=", "cli", ".", "CurrentContext", "(", ")", "\n", "ctxRaw", ",", "err", ":=", "cli", ".", "C...
// StackOrchestrator resolves which stack orchestrator is in use
[ "StackOrchestrator", "resolves", "which", "stack", "orchestrator", "is", "in", "use" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L400-L416
159,821
docker/cli
cli/command/cli.go
Apply
func (cli *DockerCli) Apply(ops ...DockerCliOption) error { for _, op := range ops { if err := op(cli); err != nil { return err } } return nil }
go
func (cli *DockerCli) Apply(ops ...DockerCliOption) error { for _, op := range ops { if err := op(cli); err != nil { return err } } return nil }
[ "func", "(", "cli", "*", "DockerCli", ")", "Apply", "(", "ops", "...", "DockerCliOption", ")", "error", "{", "for", "_", ",", "op", ":=", "range", "ops", "{", "if", "err", ":=", "op", "(", "cli", ")", ";", "err", "!=", "nil", "{", "return", "err"...
// Apply all the operation on the cli
[ "Apply", "all", "the", "operation", "on", "the", "cli" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L424-L431
159,822
docker/cli
cli/command/cli.go
NewDockerCli
func NewDockerCli(ops ...DockerCliOption) (*DockerCli, error) { cli := &DockerCli{} defaultOps := []DockerCliOption{ WithContentTrustFromEnv(), WithContainerizedClient(containerizedengine.NewClient), } cli.contextStoreConfig = defaultContextStoreConfig() ops = append(defaultOps, ops...) if err := cli.Apply(op...
go
func NewDockerCli(ops ...DockerCliOption) (*DockerCli, error) { cli := &DockerCli{} defaultOps := []DockerCliOption{ WithContentTrustFromEnv(), WithContainerizedClient(containerizedengine.NewClient), } cli.contextStoreConfig = defaultContextStoreConfig() ops = append(defaultOps, ops...) if err := cli.Apply(op...
[ "func", "NewDockerCli", "(", "ops", "...", "DockerCliOption", ")", "(", "*", "DockerCli", ",", "error", ")", "{", "cli", ":=", "&", "DockerCli", "{", "}", "\n", "defaultOps", ":=", "[", "]", "DockerCliOption", "{", "WithContentTrustFromEnv", "(", ")", ",",...
// NewDockerCli returns a DockerCli instance with all operators applied on it. // It applies by default the standard streams, the content trust from // environment and the default containerized client constructor operations.
[ "NewDockerCli", "returns", "a", "DockerCli", "instance", "with", "all", "operators", "applied", "on", "it", ".", "It", "applies", "by", "default", "the", "standard", "streams", "the", "content", "trust", "from", "environment", "and", "the", "default", "container...
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/cli.go#L450-L474
159,823
docker/cli
cli/command/config/create.go
RunConfigCreate
func RunConfigCreate(dockerCli command.Cli, options CreateOptions) error { client := dockerCli.Client() ctx := context.Background() var in io.Reader = dockerCli.In() if options.File != "-" { file, err := system.OpenSequential(options.File) if err != nil { return err } in = file defer file.Close() } ...
go
func RunConfigCreate(dockerCli command.Cli, options CreateOptions) error { client := dockerCli.Client() ctx := context.Background() var in io.Reader = dockerCli.In() if options.File != "-" { file, err := system.OpenSequential(options.File) if err != nil { return err } in = file defer file.Close() } ...
[ "func", "RunConfigCreate", "(", "dockerCli", "command", ".", "Cli", ",", "options", "CreateOptions", ")", "error", "{", "client", ":=", "dockerCli", ".", "Client", "(", ")", "\n", "ctx", ":=", "context", ".", "Background", "(", ")", "\n\n", "var", "in", ...
// RunConfigCreate creates a config with the given options.
[ "RunConfigCreate", "creates", "a", "config", "with", "the", "given", "options", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/config/create.go#L50-L88
159,824
docker/cli
cli/command/container/port.go
NewPortCommand
func NewPortCommand(dockerCli command.Cli) *cobra.Command { var opts portOptions cmd := &cobra.Command{ Use: "port CONTAINER [PRIVATE_PORT[/PROTO]]", Short: "List port mappings or a specific mapping for the container", Args: cli.RequiresRangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error ...
go
func NewPortCommand(dockerCli command.Cli) *cobra.Command { var opts portOptions cmd := &cobra.Command{ Use: "port CONTAINER [PRIVATE_PORT[/PROTO]]", Short: "List port mappings or a specific mapping for the container", Args: cli.RequiresRangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error ...
[ "func", "NewPortCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "portOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",...
// NewPortCommand creates a new cobra.Command for `docker port`
[ "NewPortCommand", "creates", "a", "new", "cobra", ".", "Command", "for", "docker", "port" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/container/port.go#L22-L38
159,825
docker/cli
cli/command/stack/kubernetes/remove.go
RunRemove
func RunRemove(dockerCli *KubeCli, opts options.Remove) error { composeClient, err := dockerCli.composeClient() if err != nil { return err } stacks, err := composeClient.Stacks(false) if err != nil { return err } for _, stack := range opts.Namespaces { fmt.Fprintf(dockerCli.Out(), "Removing stack: %s\n", s...
go
func RunRemove(dockerCli *KubeCli, opts options.Remove) error { composeClient, err := dockerCli.composeClient() if err != nil { return err } stacks, err := composeClient.Stacks(false) if err != nil { return err } for _, stack := range opts.Namespaces { fmt.Fprintf(dockerCli.Out(), "Removing stack: %s\n", s...
[ "func", "RunRemove", "(", "dockerCli", "*", "KubeCli", ",", "opts", "options", ".", "Remove", ")", "error", "{", "composeClient", ",", "err", ":=", "dockerCli", ".", "composeClient", "(", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", ...
// RunRemove is the kubernetes implementation of docker stack remove
[ "RunRemove", "is", "the", "kubernetes", "implementation", "of", "docker", "stack", "remove" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/kubernetes/remove.go#L11-L27
159,826
docker/cli
cli/registry/client/fetcher.go
fetchManifest
func fetchManifest(ctx context.Context, repo distribution.Repository, ref reference.Named) (types.ImageManifest, error) { manifest, err := getManifest(ctx, repo, ref) if err != nil { return types.ImageManifest{}, err } switch v := manifest.(type) { // Removed Schema 1 support case *schema2.DeserializedManifest...
go
func fetchManifest(ctx context.Context, repo distribution.Repository, ref reference.Named) (types.ImageManifest, error) { manifest, err := getManifest(ctx, repo, ref) if err != nil { return types.ImageManifest{}, err } switch v := manifest.(type) { // Removed Schema 1 support case *schema2.DeserializedManifest...
[ "func", "fetchManifest", "(", "ctx", "context", ".", "Context", ",", "repo", "distribution", ".", "Repository", ",", "ref", "reference", ".", "Named", ")", "(", "types", ".", "ImageManifest", ",", "error", ")", "{", "manifest", ",", "err", ":=", "getManife...
// fetchManifest pulls a manifest from a registry and returns it. An error // is returned if no manifest is found matching namedRef.
[ "fetchManifest", "pulls", "a", "manifest", "from", "a", "registry", "and", "returns", "it", ".", "An", "error", "is", "returned", "if", "no", "manifest", "is", "found", "matching", "namedRef", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/registry/client/fetcher.go#L25-L43
159,827
docker/cli
cli/registry/client/fetcher.go
validateManifestDigest
func validateManifestDigest(ref reference.Named, mfst distribution.Manifest) (ocispec.Descriptor, error) { mediaType, canonical, err := mfst.Payload() if err != nil { return ocispec.Descriptor{}, err } desc := ocispec.Descriptor{ Digest: digest.FromBytes(canonical), Size: int64(len(canonical)), Medi...
go
func validateManifestDigest(ref reference.Named, mfst distribution.Manifest) (ocispec.Descriptor, error) { mediaType, canonical, err := mfst.Payload() if err != nil { return ocispec.Descriptor{}, err } desc := ocispec.Descriptor{ Digest: digest.FromBytes(canonical), Size: int64(len(canonical)), Medi...
[ "func", "validateManifestDigest", "(", "ref", "reference", ".", "Named", ",", "mfst", "distribution", ".", "Manifest", ")", "(", "ocispec", ".", "Descriptor", ",", "error", ")", "{", "mediaType", ",", "canonical", ",", "err", ":=", "mfst", ".", "Payload", ...
// validateManifestDigest computes the manifest digest, and, if pulling by // digest, ensures that it matches the requested digest.
[ "validateManifestDigest", "computes", "the", "manifest", "digest", "and", "if", "pulling", "by", "digest", "ensures", "that", "it", "matches", "the", "requested", "digest", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/registry/client/fetcher.go#L120-L140
159,828
docker/cli
cli/compose/convert/compose.go
Descope
func (n Namespace) Descope(name string) string { return strings.TrimPrefix(name, n.name+"_") }
go
func (n Namespace) Descope(name string) string { return strings.TrimPrefix(name, n.name+"_") }
[ "func", "(", "n", "Namespace", ")", "Descope", "(", "name", "string", ")", "string", "{", "return", "strings", ".", "TrimPrefix", "(", "name", ",", "n", ".", "name", "+", "\"", "\"", ")", "\n", "}" ]
// Descope returns the name without the namespace prefix
[ "Descope", "returns", "the", "name", "without", "the", "namespace", "prefix" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/convert/compose.go#L29-L31
159,829
docker/cli
cli/compose/convert/compose.go
AddStackLabel
func AddStackLabel(namespace Namespace, labels map[string]string) map[string]string { if labels == nil { labels = make(map[string]string) } labels[LabelNamespace] = namespace.name return labels }
go
func AddStackLabel(namespace Namespace, labels map[string]string) map[string]string { if labels == nil { labels = make(map[string]string) } labels[LabelNamespace] = namespace.name return labels }
[ "func", "AddStackLabel", "(", "namespace", "Namespace", ",", "labels", "map", "[", "string", "]", "string", ")", "map", "[", "string", "]", "string", "{", "if", "labels", "==", "nil", "{", "labels", "=", "make", "(", "map", "[", "string", "]", "string"...
// AddStackLabel returns labels with the namespace label added
[ "AddStackLabel", "returns", "labels", "with", "the", "namespace", "label", "added" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/convert/compose.go#L44-L50
159,830
docker/cli
cli/compose/convert/compose.go
Networks
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]types.NetworkCreate, []string) { if networks == nil { networks = make(map[string]composetypes.NetworkConfig) } externalNetworks := []string{} result := make(map[string]types.NetworkCreate) for internalName ...
go
func Networks(namespace Namespace, networks networkMap, servicesNetworks map[string]struct{}) (map[string]types.NetworkCreate, []string) { if networks == nil { networks = make(map[string]composetypes.NetworkConfig) } externalNetworks := []string{} result := make(map[string]types.NetworkCreate) for internalName ...
[ "func", "Networks", "(", "namespace", "Namespace", ",", "networks", "networkMap", ",", "servicesNetworks", "map", "[", "string", "]", "struct", "{", "}", ")", "(", "map", "[", "string", "]", "types", ".", "NetworkCreate", ",", "[", "]", "string", ")", "{...
// Networks from the compose-file type to the engine API type
[ "Networks", "from", "the", "compose", "-", "file", "type", "to", "the", "engine", "API", "type" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/convert/compose.go#L55-L99
159,831
docker/cli
cli/compose/convert/compose.go
Secrets
func Secrets(namespace Namespace, secrets map[string]composetypes.SecretConfig) ([]swarm.SecretSpec, error) { result := []swarm.SecretSpec{} for name, secret := range secrets { if secret.External.External { continue } var obj swarmFileObject var err error if secret.Driver != "" { obj, err = driverObj...
go
func Secrets(namespace Namespace, secrets map[string]composetypes.SecretConfig) ([]swarm.SecretSpec, error) { result := []swarm.SecretSpec{} for name, secret := range secrets { if secret.External.External { continue } var obj swarmFileObject var err error if secret.Driver != "" { obj, err = driverObj...
[ "func", "Secrets", "(", "namespace", "Namespace", ",", "secrets", "map", "[", "string", "]", "composetypes", ".", "SecretConfig", ")", "(", "[", "]", "swarm", ".", "SecretSpec", ",", "error", ")", "{", "result", ":=", "[", "]", "swarm", ".", "SecretSpec"...
// Secrets converts secrets from the Compose type to the engine API type
[ "Secrets", "converts", "secrets", "from", "the", "Compose", "type", "to", "the", "engine", "API", "type" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/compose/convert/compose.go#L102-L134
159,832
docker/cli
cli/connhelper/connhelper.go
GetCommandConnectionHelper
func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper, error) { return &ConnectionHelper{ Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { return commandconn.New(ctx, cmd, flags...) }, Host: "http://docker", }, nil }
go
func GetCommandConnectionHelper(cmd string, flags ...string) (*ConnectionHelper, error) { return &ConnectionHelper{ Dialer: func(ctx context.Context, network, addr string) (net.Conn, error) { return commandconn.New(ctx, cmd, flags...) }, Host: "http://docker", }, nil }
[ "func", "GetCommandConnectionHelper", "(", "cmd", "string", ",", "flags", "...", "string", ")", "(", "*", "ConnectionHelper", ",", "error", ")", "{", "return", "&", "ConnectionHelper", "{", "Dialer", ":", "func", "(", "ctx", "context", ".", "Context", ",", ...
// GetCommandConnectionHelper returns Docker-specific connection helper constructed from an arbitrary command.
[ "GetCommandConnectionHelper", "returns", "Docker", "-", "specific", "connection", "helper", "constructed", "from", "an", "arbitrary", "command", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/connhelper/connhelper.go#L48-L55
159,833
docker/cli
cli/command/checkpoint/formatter.go
NewFormat
func NewFormat(source string) formatter.Format { switch source { case formatter.TableFormatKey: return defaultCheckpointFormat } return formatter.Format(source) }
go
func NewFormat(source string) formatter.Format { switch source { case formatter.TableFormatKey: return defaultCheckpointFormat } return formatter.Format(source) }
[ "func", "NewFormat", "(", "source", "string", ")", "formatter", ".", "Format", "{", "switch", "source", "{", "case", "formatter", ".", "TableFormatKey", ":", "return", "defaultCheckpointFormat", "\n", "}", "\n", "return", "formatter", ".", "Format", "(", "sour...
// NewFormat returns a format for use with a checkpoint Context
[ "NewFormat", "returns", "a", "format", "for", "use", "with", "a", "checkpoint", "Context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/checkpoint/formatter.go#L15-L21
159,834
docker/cli
cli/command/checkpoint/formatter.go
FormatWrite
func FormatWrite(ctx formatter.Context, checkpoints []types.Checkpoint) error { render := func(format func(subContext formatter.SubContext) error) error { for _, checkpoint := range checkpoints { if err := format(&checkpointContext{c: checkpoint}); err != nil { return err } } return nil } return ctx....
go
func FormatWrite(ctx formatter.Context, checkpoints []types.Checkpoint) error { render := func(format func(subContext formatter.SubContext) error) error { for _, checkpoint := range checkpoints { if err := format(&checkpointContext{c: checkpoint}); err != nil { return err } } return nil } return ctx....
[ "func", "FormatWrite", "(", "ctx", "formatter", ".", "Context", ",", "checkpoints", "[", "]", "types", ".", "Checkpoint", ")", "error", "{", "render", ":=", "func", "(", "format", "func", "(", "subContext", "formatter", ".", "SubContext", ")", "error", ")"...
// FormatWrite writes formatted checkpoints using the Context
[ "FormatWrite", "writes", "formatted", "checkpoints", "using", "the", "Context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/checkpoint/formatter.go#L24-L34
159,835
docker/cli
cli/command/image/history.go
NewHistoryCommand
func NewHistoryCommand(dockerCli command.Cli) *cobra.Command { var opts historyOptions cmd := &cobra.Command{ Use: "history [OPTIONS] IMAGE", Short: "Show the history of an image", Args: cli.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.image = args[0] return runHistory(do...
go
func NewHistoryCommand(dockerCli command.Cli) *cobra.Command { var opts historyOptions cmd := &cobra.Command{ Use: "history [OPTIONS] IMAGE", Short: "Show the history of an image", Args: cli.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { opts.image = args[0] return runHistory(do...
[ "func", "NewHistoryCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "historyOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\""...
// NewHistoryCommand creates a new `docker history` command
[ "NewHistoryCommand", "creates", "a", "new", "docker", "history", "command" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/image/history.go#L22-L43
159,836
docker/cli
cli/command/formatter/buildcache.go
NewBuildCacheFormat
func NewBuildCacheFormat(source string, quiet bool) Format { switch source { case TableFormatKey: if quiet { return DefaultQuietFormat } return Format(defaultBuildCacheTableFormat) case RawFormatKey: if quiet { return `build_cache_id: {{.ID}}` } format := `build_cache_id: {{.ID}} parent_id: {{.Pare...
go
func NewBuildCacheFormat(source string, quiet bool) Format { switch source { case TableFormatKey: if quiet { return DefaultQuietFormat } return Format(defaultBuildCacheTableFormat) case RawFormatKey: if quiet { return `build_cache_id: {{.ID}}` } format := `build_cache_id: {{.ID}} parent_id: {{.Pare...
[ "func", "NewBuildCacheFormat", "(", "source", "string", ",", "quiet", "bool", ")", "Format", "{", "switch", "source", "{", "case", "TableFormatKey", ":", "if", "quiet", "{", "return", "DefaultQuietFormat", "\n", "}", "\n", "return", "Format", "(", "defaultBuil...
// NewBuildCacheFormat returns a Format for rendering using a Context
[ "NewBuildCacheFormat", "returns", "a", "Format", "for", "rendering", "using", "a", "Context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/formatter/buildcache.go#L27-L53
159,837
docker/cli
cli/command/formatter/buildcache.go
BuildCacheWrite
func BuildCacheWrite(ctx Context, buildCaches []*types.BuildCache) error { render := func(format func(subContext SubContext) error) error { buildCacheSort(buildCaches) for _, bc := range buildCaches { err := format(&buildCacheContext{trunc: ctx.Trunc, v: bc}) if err != nil { return err } } return ...
go
func BuildCacheWrite(ctx Context, buildCaches []*types.BuildCache) error { render := func(format func(subContext SubContext) error) error { buildCacheSort(buildCaches) for _, bc := range buildCaches { err := format(&buildCacheContext{trunc: ctx.Trunc, v: bc}) if err != nil { return err } } return ...
[ "func", "BuildCacheWrite", "(", "ctx", "Context", ",", "buildCaches", "[", "]", "*", "types", ".", "BuildCache", ")", "error", "{", "render", ":=", "func", "(", "format", "func", "(", "subContext", "SubContext", ")", "error", ")", "error", "{", "buildCache...
// BuildCacheWrite renders the context for a list of containers
[ "BuildCacheWrite", "renders", "the", "context", "for", "a", "list", "of", "containers" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/formatter/buildcache.go#L74-L86
159,838
docker/cli
cli/config/configfile/file.go
New
func New(fn string) *ConfigFile { return &ConfigFile{ AuthConfigs: make(map[string]types.AuthConfig), HTTPHeaders: make(map[string]string), Filename: fn, Plugins: make(map[string]map[string]string), Aliases: make(map[string]string), } }
go
func New(fn string) *ConfigFile { return &ConfigFile{ AuthConfigs: make(map[string]types.AuthConfig), HTTPHeaders: make(map[string]string), Filename: fn, Plugins: make(map[string]map[string]string), Aliases: make(map[string]string), } }
[ "func", "New", "(", "fn", "string", ")", "*", "ConfigFile", "{", "return", "&", "ConfigFile", "{", "AuthConfigs", ":", "make", "(", "map", "[", "string", "]", "types", ".", "AuthConfig", ")", ",", "HTTPHeaders", ":", "make", "(", "map", "[", "string", ...
// New initializes an empty configuration file for the given filename 'fn'
[ "New", "initializes", "an", "empty", "configuration", "file", "for", "the", "given", "filename", "fn" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L70-L78
159,839
docker/cli
cli/config/configfile/file.go
LegacyLoadFromReader
func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error { b, err := ioutil.ReadAll(configData) if err != nil { return err } if err := json.Unmarshal(b, &configFile.AuthConfigs); err != nil { arr := strings.Split(string(b), "\n") if len(arr) < 2 { return errors.Errorf("The Auth confi...
go
func (configFile *ConfigFile) LegacyLoadFromReader(configData io.Reader) error { b, err := ioutil.ReadAll(configData) if err != nil { return err } if err := json.Unmarshal(b, &configFile.AuthConfigs); err != nil { arr := strings.Split(string(b), "\n") if len(arr) < 2 { return errors.Errorf("The Auth confi...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "LegacyLoadFromReader", "(", "configData", "io", ".", "Reader", ")", "error", "{", "b", ",", "err", ":=", "ioutil", ".", "ReadAll", "(", "configData", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// LegacyLoadFromReader reads the non-nested configuration data given and sets up the // auth config information with given directory and populates the receiver object
[ "LegacyLoadFromReader", "reads", "the", "non", "-", "nested", "configuration", "data", "given", "and", "sets", "up", "the", "auth", "config", "information", "with", "given", "directory", "and", "populates", "the", "receiver", "object" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L82-L116
159,840
docker/cli
cli/config/configfile/file.go
LoadFromReader
func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error { if err := json.NewDecoder(configData).Decode(&configFile); err != nil { return err } var err error for addr, ac := range configFile.AuthConfigs { ac.Username, ac.Password, err = decodeAuth(ac.Auth) if err != nil { return err } a...
go
func (configFile *ConfigFile) LoadFromReader(configData io.Reader) error { if err := json.NewDecoder(configData).Decode(&configFile); err != nil { return err } var err error for addr, ac := range configFile.AuthConfigs { ac.Username, ac.Password, err = decodeAuth(ac.Auth) if err != nil { return err } a...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "LoadFromReader", "(", "configData", "io", ".", "Reader", ")", "error", "{", "if", "err", ":=", "json", ".", "NewDecoder", "(", "configData", ")", ".", "Decode", "(", "&", "configFile", ")", ";", "err", ...
// LoadFromReader reads the configuration data given and sets up the auth config // information with given directory and populates the receiver object
[ "LoadFromReader", "reads", "the", "configuration", "data", "given", "and", "sets", "up", "the", "auth", "config", "information", "with", "given", "directory", "and", "populates", "the", "receiver", "object" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L120-L135
159,841
docker/cli
cli/config/configfile/file.go
ContainsAuth
func (configFile *ConfigFile) ContainsAuth() bool { return configFile.CredentialsStore != "" || len(configFile.CredentialHelpers) > 0 || len(configFile.AuthConfigs) > 0 }
go
func (configFile *ConfigFile) ContainsAuth() bool { return configFile.CredentialsStore != "" || len(configFile.CredentialHelpers) > 0 || len(configFile.AuthConfigs) > 0 }
[ "func", "(", "configFile", "*", "ConfigFile", ")", "ContainsAuth", "(", ")", "bool", "{", "return", "configFile", ".", "CredentialsStore", "!=", "\"", "\"", "||", "len", "(", "configFile", ".", "CredentialHelpers", ")", ">", "0", "||", "len", "(", "configF...
// ContainsAuth returns whether there is authentication configured // in this file or not.
[ "ContainsAuth", "returns", "whether", "there", "is", "authentication", "configured", "in", "this", "file", "or", "not", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L139-L143
159,842
docker/cli
cli/config/configfile/file.go
SaveToWriter
func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error { // Encode sensitive data into a new/temp struct tmpAuthConfigs := make(map[string]types.AuthConfig, len(configFile.AuthConfigs)) for k, authConfig := range configFile.AuthConfigs { authCopy := authConfig // encode and save the authstring, while...
go
func (configFile *ConfigFile) SaveToWriter(writer io.Writer) error { // Encode sensitive data into a new/temp struct tmpAuthConfigs := make(map[string]types.AuthConfig, len(configFile.AuthConfigs)) for k, authConfig := range configFile.AuthConfigs { authCopy := authConfig // encode and save the authstring, while...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "SaveToWriter", "(", "writer", "io", ".", "Writer", ")", "error", "{", "// Encode sensitive data into a new/temp struct", "tmpAuthConfigs", ":=", "make", "(", "map", "[", "string", "]", "types", ".", "AuthConfig",...
// SaveToWriter encodes and writes out all the authorization information to // the given writer
[ "SaveToWriter", "encodes", "and", "writes", "out", "all", "the", "authorization", "information", "to", "the", "given", "writer" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L152-L175
159,843
docker/cli
cli/config/configfile/file.go
ParseProxyConfig
func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts map[string]*string) map[string]*string { var cfgKey string if _, ok := configFile.Proxies[host]; !ok { cfgKey = "default" } else { cfgKey = host } config := configFile.Proxies[cfgKey] permitted := map[string]*string{ "HTTP_PROXY": &confi...
go
func (configFile *ConfigFile) ParseProxyConfig(host string, runOpts map[string]*string) map[string]*string { var cfgKey string if _, ok := configFile.Proxies[host]; !ok { cfgKey = "default" } else { cfgKey = host } config := configFile.Proxies[cfgKey] permitted := map[string]*string{ "HTTP_PROXY": &confi...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "ParseProxyConfig", "(", "host", "string", ",", "runOpts", "map", "[", "string", "]", "*", "string", ")", "map", "[", "string", "]", "*", "string", "{", "var", "cfgKey", "string", "\n\n", "if", "_", ",...
// ParseProxyConfig computes proxy configuration by retrieving the config for the provided host and // then checking this against any environment variables provided to the container
[ "ParseProxyConfig", "computes", "proxy", "configuration", "by", "retrieving", "the", "config", "for", "the", "provided", "host", "and", "then", "checking", "this", "against", "any", "environment", "variables", "provided", "to", "the", "container" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L202-L234
159,844
docker/cli
cli/config/configfile/file.go
encodeAuth
func encodeAuth(authConfig *types.AuthConfig) string { if authConfig.Username == "" && authConfig.Password == "" { return "" } authStr := authConfig.Username + ":" + authConfig.Password msg := []byte(authStr) encoded := make([]byte, base64.StdEncoding.EncodedLen(len(msg))) base64.StdEncoding.Encode(encoded, ms...
go
func encodeAuth(authConfig *types.AuthConfig) string { if authConfig.Username == "" && authConfig.Password == "" { return "" } authStr := authConfig.Username + ":" + authConfig.Password msg := []byte(authStr) encoded := make([]byte, base64.StdEncoding.EncodedLen(len(msg))) base64.StdEncoding.Encode(encoded, ms...
[ "func", "encodeAuth", "(", "authConfig", "*", "types", ".", "AuthConfig", ")", "string", "{", "if", "authConfig", ".", "Username", "==", "\"", "\"", "&&", "authConfig", ".", "Password", "==", "\"", "\"", "{", "return", "\"", "\"", "\n", "}", "\n\n", "a...
// encodeAuth creates a base64 encoded string to containing authorization information
[ "encodeAuth", "creates", "a", "base64", "encoded", "string", "to", "containing", "authorization", "information" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L237-L247
159,845
docker/cli
cli/config/configfile/file.go
decodeAuth
func decodeAuth(authStr string) (string, string, error) { if authStr == "" { return "", "", nil } decLen := base64.StdEncoding.DecodedLen(len(authStr)) decoded := make([]byte, decLen) authByte := []byte(authStr) n, err := base64.StdEncoding.Decode(decoded, authByte) if err != nil { return "", "", err } if...
go
func decodeAuth(authStr string) (string, string, error) { if authStr == "" { return "", "", nil } decLen := base64.StdEncoding.DecodedLen(len(authStr)) decoded := make([]byte, decLen) authByte := []byte(authStr) n, err := base64.StdEncoding.Decode(decoded, authByte) if err != nil { return "", "", err } if...
[ "func", "decodeAuth", "(", "authStr", "string", ")", "(", "string", ",", "string", ",", "error", ")", "{", "if", "authStr", "==", "\"", "\"", "{", "return", "\"", "\"", ",", "\"", "\"", ",", "nil", "\n", "}", "\n\n", "decLen", ":=", "base64", ".", ...
// decodeAuth decodes a base64 encoded string and returns username and password
[ "decodeAuth", "decodes", "a", "base64", "encoded", "string", "and", "returns", "username", "and", "password" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L250-L271
159,846
docker/cli
cli/config/configfile/file.go
GetCredentialsStore
func (configFile *ConfigFile) GetCredentialsStore(registryHostname string) credentials.Store { if helper := getConfiguredCredentialStore(configFile, registryHostname); helper != "" { return newNativeStore(configFile, helper) } return credentials.NewFileStore(configFile) }
go
func (configFile *ConfigFile) GetCredentialsStore(registryHostname string) credentials.Store { if helper := getConfiguredCredentialStore(configFile, registryHostname); helper != "" { return newNativeStore(configFile, helper) } return credentials.NewFileStore(configFile) }
[ "func", "(", "configFile", "*", "ConfigFile", ")", "GetCredentialsStore", "(", "registryHostname", "string", ")", "credentials", ".", "Store", "{", "if", "helper", ":=", "getConfiguredCredentialStore", "(", "configFile", ",", "registryHostname", ")", ";", "helper", ...
// GetCredentialsStore returns a new credentials store from the settings in the // configuration file
[ "GetCredentialsStore", "returns", "a", "new", "credentials", "store", "from", "the", "settings", "in", "the", "configuration", "file" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L275-L280
159,847
docker/cli
cli/config/configfile/file.go
GetAuthConfig
func (configFile *ConfigFile) GetAuthConfig(registryHostname string) (types.AuthConfig, error) { return configFile.GetCredentialsStore(registryHostname).Get(registryHostname) }
go
func (configFile *ConfigFile) GetAuthConfig(registryHostname string) (types.AuthConfig, error) { return configFile.GetCredentialsStore(registryHostname).Get(registryHostname) }
[ "func", "(", "configFile", "*", "ConfigFile", ")", "GetAuthConfig", "(", "registryHostname", "string", ")", "(", "types", ".", "AuthConfig", ",", "error", ")", "{", "return", "configFile", ".", "GetCredentialsStore", "(", "registryHostname", ")", ".", "Get", "...
// GetAuthConfig for a repository from the credential store
[ "GetAuthConfig", "for", "a", "repository", "from", "the", "credential", "store" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L288-L290
159,848
docker/cli
cli/config/configfile/file.go
getConfiguredCredentialStore
func getConfiguredCredentialStore(c *ConfigFile, registryHostname string) string { if c.CredentialHelpers != nil && registryHostname != "" { if helper, exists := c.CredentialHelpers[registryHostname]; exists { return helper } } return c.CredentialsStore }
go
func getConfiguredCredentialStore(c *ConfigFile, registryHostname string) string { if c.CredentialHelpers != nil && registryHostname != "" { if helper, exists := c.CredentialHelpers[registryHostname]; exists { return helper } } return c.CredentialsStore }
[ "func", "getConfiguredCredentialStore", "(", "c", "*", "ConfigFile", ",", "registryHostname", "string", ")", "string", "{", "if", "c", ".", "CredentialHelpers", "!=", "nil", "&&", "registryHostname", "!=", "\"", "\"", "{", "if", "helper", ",", "exists", ":=", ...
// getConfiguredCredentialStore returns the credential helper configured for the // given registry, the default credsStore, or the empty string if neither are // configured.
[ "getConfiguredCredentialStore", "returns", "the", "credential", "helper", "configured", "for", "the", "given", "registry", "the", "default", "credsStore", "or", "the", "empty", "string", "if", "neither", "are", "configured", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L295-L302
159,849
docker/cli
cli/config/configfile/file.go
GetAllCredentials
func (configFile *ConfigFile) GetAllCredentials() (map[string]types.AuthConfig, error) { auths := make(map[string]types.AuthConfig) addAll := func(from map[string]types.AuthConfig) { for reg, ac := range from { auths[reg] = ac } } defaultStore := configFile.GetCredentialsStore("") newAuths, err := defaultS...
go
func (configFile *ConfigFile) GetAllCredentials() (map[string]types.AuthConfig, error) { auths := make(map[string]types.AuthConfig) addAll := func(from map[string]types.AuthConfig) { for reg, ac := range from { auths[reg] = ac } } defaultStore := configFile.GetCredentialsStore("") newAuths, err := defaultS...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "GetAllCredentials", "(", ")", "(", "map", "[", "string", "]", "types", ".", "AuthConfig", ",", "error", ")", "{", "auths", ":=", "make", "(", "map", "[", "string", "]", "types", ".", "AuthConfig", ")"...
// GetAllCredentials returns all of the credentials stored in all of the // configured credential stores.
[ "GetAllCredentials", "returns", "all", "of", "the", "credentials", "stored", "in", "all", "of", "the", "configured", "credential", "stores", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L306-L330
159,850
docker/cli
cli/config/configfile/file.go
PluginConfig
func (configFile *ConfigFile) PluginConfig(pluginname, option string) (string, bool) { if configFile.Plugins == nil { return "", false } pluginConfig, ok := configFile.Plugins[pluginname] if !ok { return "", false } value, ok := pluginConfig[option] return value, ok }
go
func (configFile *ConfigFile) PluginConfig(pluginname, option string) (string, bool) { if configFile.Plugins == nil { return "", false } pluginConfig, ok := configFile.Plugins[pluginname] if !ok { return "", false } value, ok := pluginConfig[option] return value, ok }
[ "func", "(", "configFile", "*", "ConfigFile", ")", "PluginConfig", "(", "pluginname", ",", "option", "string", ")", "(", "string", ",", "bool", ")", "{", "if", "configFile", ".", "Plugins", "==", "nil", "{", "return", "\"", "\"", ",", "false", "\n", "}...
// PluginConfig retrieves the requested option for the given plugin.
[ "PluginConfig", "retrieves", "the", "requested", "option", "for", "the", "given", "plugin", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L338-L348
159,851
docker/cli
cli/config/configfile/file.go
SetPluginConfig
func (configFile *ConfigFile) SetPluginConfig(pluginname, option, value string) { if configFile.Plugins == nil { configFile.Plugins = make(map[string]map[string]string) } pluginConfig, ok := configFile.Plugins[pluginname] if !ok { pluginConfig = make(map[string]string) configFile.Plugins[pluginname] = pluginC...
go
func (configFile *ConfigFile) SetPluginConfig(pluginname, option, value string) { if configFile.Plugins == nil { configFile.Plugins = make(map[string]map[string]string) } pluginConfig, ok := configFile.Plugins[pluginname] if !ok { pluginConfig = make(map[string]string) configFile.Plugins[pluginname] = pluginC...
[ "func", "(", "configFile", "*", "ConfigFile", ")", "SetPluginConfig", "(", "pluginname", ",", "option", ",", "value", "string", ")", "{", "if", "configFile", ".", "Plugins", "==", "nil", "{", "configFile", ".", "Plugins", "=", "make", "(", "map", "[", "s...
// SetPluginConfig sets the option to the given value for the given // plugin. Passing a value of "" will remove the option. If removing // the final config item for a given plugin then also cleans up the // overall plugin entry.
[ "SetPluginConfig", "sets", "the", "option", "to", "the", "given", "value", "for", "the", "given", "plugin", ".", "Passing", "a", "value", "of", "will", "remove", "the", "option", ".", "If", "removing", "the", "final", "config", "item", "for", "a", "given",...
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/config/configfile/file.go#L354-L371
159,852
docker/cli
cli/command/context/inspect.go
newInspectCommand
func newInspectCommand(dockerCli command.Cli) *cobra.Command { var opts inspectOptions cmd := &cobra.Command{ Use: "inspect [OPTIONS] [CONTEXT] [CONTEXT...]", Short: "Display detailed information on one or more contexts", RunE: func(cmd *cobra.Command, args []string) error { opts.refs = args if len(opt...
go
func newInspectCommand(dockerCli command.Cli) *cobra.Command { var opts inspectOptions cmd := &cobra.Command{ Use: "inspect [OPTIONS] [CONTEXT] [CONTEXT...]", Short: "Display detailed information on one or more contexts", RunE: func(cmd *cobra.Command, args []string) error { opts.refs = args if len(opt...
[ "func", "newInspectCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "inspectOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\""...
// newInspectCommand creates a new cobra.Command for `docker image inspect`
[ "newInspectCommand", "creates", "a", "new", "cobra", ".", "Command", "for", "docker", "image", "inspect" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/context/inspect.go#L18-L39
159,853
docker/cli
cli/command/manifest/inspect.go
newInspectCommand
func newInspectCommand(dockerCli command.Cli) *cobra.Command { var opts inspectOptions cmd := &cobra.Command{ Use: "inspect [OPTIONS] [MANIFEST_LIST] MANIFEST", Short: "Display an image manifest, or manifest list", Args: cli.RequiresRangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error { ...
go
func newInspectCommand(dockerCli command.Cli) *cobra.Command { var opts inspectOptions cmd := &cobra.Command{ Use: "inspect [OPTIONS] [MANIFEST_LIST] MANIFEST", Short: "Display an image manifest, or manifest list", Args: cli.RequiresRangeArgs(1, 2), RunE: func(cmd *cobra.Command, args []string) error { ...
[ "func", "newInspectCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "inspectOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\""...
// NewInspectCommand creates a new `docker manifest inspect` command
[ "NewInspectCommand", "creates", "a", "new", "docker", "manifest", "inspect", "command" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/manifest/inspect.go#L27-L50
159,854
docker/cli
cli/command/plugin/create.go
validateTag
func validateTag(rawRepo string) error { _, err := reference.ParseNormalizedNamed(rawRepo) return err }
go
func validateTag(rawRepo string) error { _, err := reference.ParseNormalizedNamed(rawRepo) return err }
[ "func", "validateTag", "(", "rawRepo", "string", ")", "error", "{", "_", ",", "err", ":=", "reference", ".", "ParseNormalizedNamed", "(", "rawRepo", ")", "\n\n", "return", "err", "\n", "}" ]
// validateTag checks if the given repoName can be resolved.
[ "validateTag", "checks", "if", "the", "given", "repoName", "can", "be", "resolved", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/plugin/create.go#L22-L26
159,855
docker/cli
cli/command/plugin/create.go
validateConfig
func validateConfig(path string) error { dt, err := os.Open(filepath.Join(path, "config.json")) if err != nil { return err } m := types.PluginConfig{} err = json.NewDecoder(dt).Decode(&m) dt.Close() return err }
go
func validateConfig(path string) error { dt, err := os.Open(filepath.Join(path, "config.json")) if err != nil { return err } m := types.PluginConfig{} err = json.NewDecoder(dt).Decode(&m) dt.Close() return err }
[ "func", "validateConfig", "(", "path", "string", ")", "error", "{", "dt", ",", "err", ":=", "os", ".", "Open", "(", "filepath", ".", "Join", "(", "path", ",", "\"", "\"", ")", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", ...
// validateConfig ensures that a valid config.json is available in the given path
[ "validateConfig", "ensures", "that", "a", "valid", "config", ".", "json", "is", "available", "in", "the", "given", "path" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/plugin/create.go#L29-L40
159,856
docker/cli
cli/command/plugin/create.go
validateContextDir
func validateContextDir(contextDir string) (string, error) { absContextDir, err := filepath.Abs(contextDir) if err != nil { return "", err } stat, err := os.Lstat(absContextDir) if err != nil { return "", err } if !stat.IsDir() { return "", errors.Errorf("context must be a directory") } return absConte...
go
func validateContextDir(contextDir string) (string, error) { absContextDir, err := filepath.Abs(contextDir) if err != nil { return "", err } stat, err := os.Lstat(absContextDir) if err != nil { return "", err } if !stat.IsDir() { return "", errors.Errorf("context must be a directory") } return absConte...
[ "func", "validateContextDir", "(", "contextDir", "string", ")", "(", "string", ",", "error", ")", "{", "absContextDir", ",", "err", ":=", "filepath", ".", "Abs", "(", "contextDir", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "e...
// validateContextDir validates the given dir and returns abs path on success.
[ "validateContextDir", "validates", "the", "given", "dir", "and", "returns", "abs", "path", "on", "success", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/plugin/create.go#L43-L58
159,857
docker/cli
cli/command/context/update.go
RunUpdate
func RunUpdate(cli command.Cli, o *UpdateOptions) error { if err := validateContextName(o.Name); err != nil { return err } s := cli.ContextStore() c, err := s.GetMetadata(o.Name) if err != nil { return err } dockerContext, err := command.GetDockerContext(c) if err != nil { return err } if o.DefaultStack...
go
func RunUpdate(cli command.Cli, o *UpdateOptions) error { if err := validateContextName(o.Name); err != nil { return err } s := cli.ContextStore() c, err := s.GetMetadata(o.Name) if err != nil { return err } dockerContext, err := command.GetDockerContext(c) if err != nil { return err } if o.DefaultStack...
[ "func", "RunUpdate", "(", "cli", "command", ".", "Cli", ",", "o", "*", "UpdateOptions", ")", "error", "{", "if", "err", ":=", "validateContextName", "(", "o", ".", "Name", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "s", ":...
// RunUpdate updates a Docker context
[ "RunUpdate", "updates", "a", "Docker", "context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/context/update.go#L70-L133
159,858
docker/cli
cli/command/service/update.go
removeConfigs
func removeConfigs(flags *pflag.FlagSet, spec *swarm.ContainerSpec, credSpecName, credSpecID string) []*swarm.ConfigReference { keepConfigs := []*swarm.ConfigReference{} toRemove := buildToRemoveSet(flags, flagConfigRemove) // all configs in spec.Configs should have both a Name and ID, because // they come from an...
go
func removeConfigs(flags *pflag.FlagSet, spec *swarm.ContainerSpec, credSpecName, credSpecID string) []*swarm.ConfigReference { keepConfigs := []*swarm.ConfigReference{} toRemove := buildToRemoveSet(flags, flagConfigRemove) // all configs in spec.Configs should have both a Name and ID, because // they come from an...
[ "func", "removeConfigs", "(", "flags", "*", "pflag", ".", "FlagSet", ",", "spec", "*", "swarm", ".", "ContainerSpec", ",", "credSpecName", ",", "credSpecID", "string", ")", "[", "]", "*", "swarm", ".", "ConfigReference", "{", "keepConfigs", ":=", "[", "]",...
// removeConfigs figures out which configs in the existing spec should be kept // after the update.
[ "removeConfigs", "figures", "out", "which", "configs", "in", "the", "existing", "spec", "should", "be", "kept", "after", "the", "update", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/service/update.go#L800-L832
159,859
docker/cli
cli/command/service/update.go
updateLogDriver
func updateLogDriver(flags *pflag.FlagSet, taskTemplate *swarm.TaskSpec) error { if !flags.Changed(flagLogDriver) { return nil } name, err := flags.GetString(flagLogDriver) if err != nil { return err } if name == "" { return nil } taskTemplate.LogDriver = &swarm.Driver{ Name: name, Options: opts...
go
func updateLogDriver(flags *pflag.FlagSet, taskTemplate *swarm.TaskSpec) error { if !flags.Changed(flagLogDriver) { return nil } name, err := flags.GetString(flagLogDriver) if err != nil { return err } if name == "" { return nil } taskTemplate.LogDriver = &swarm.Driver{ Name: name, Options: opts...
[ "func", "updateLogDriver", "(", "flags", "*", "pflag", ".", "FlagSet", ",", "taskTemplate", "*", "swarm", ".", "TaskSpec", ")", "error", "{", "if", "!", "flags", ".", "Changed", "(", "flagLogDriver", ")", "{", "return", "nil", "\n", "}", "\n\n", "name", ...
// updateLogDriver updates the log driver only if the log driver flag is set. // All options will be replaced with those provided on the command line.
[ "updateLogDriver", "updates", "the", "log", "driver", "only", "if", "the", "log", "driver", "flag", "is", "set", ".", "All", "options", "will", "be", "replaced", "with", "those", "provided", "on", "the", "command", "line", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/service/update.go#L1174-L1194
159,860
docker/cli
cli/command/trust/key.go
newTrustKeyCommand
func newTrustKeyCommand(dockerCli command.Streams) *cobra.Command { cmd := &cobra.Command{ Use: "key", Short: "Manage keys for signing Docker images", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), } cmd.AddCommand( newKeyGenerateCommand(dockerCli), newKeyLoadCommand(dockerCli), ) retur...
go
func newTrustKeyCommand(dockerCli command.Streams) *cobra.Command { cmd := &cobra.Command{ Use: "key", Short: "Manage keys for signing Docker images", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), } cmd.AddCommand( newKeyGenerateCommand(dockerCli), newKeyLoadCommand(dockerCli), ) retur...
[ "func", "newTrustKeyCommand", "(", "dockerCli", "command", ".", "Streams", ")", "*", "cobra", ".", "Command", "{", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Args", ":", "cli", ".", ...
// newTrustKeyCommand returns a cobra command for `trust key` subcommands
[ "newTrustKeyCommand", "returns", "a", "cobra", "command", "for", "trust", "key", "subcommands" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/trust/key.go#L10-L22
159,861
docker/cli
cli/command/formatter/custom.go
Label
func (c SubHeaderContext) Label(name string) string { n := strings.Split(name, ".") r := strings.NewReplacer("-", " ", "_", " ") h := r.Replace(n[len(n)-1]) return h }
go
func (c SubHeaderContext) Label(name string) string { n := strings.Split(name, ".") r := strings.NewReplacer("-", " ", "_", " ") h := r.Replace(n[len(n)-1]) return h }
[ "func", "(", "c", "SubHeaderContext", ")", "Label", "(", "name", "string", ")", "string", "{", "n", ":=", "strings", ".", "Split", "(", "name", ",", "\"", "\"", ")", "\n", "r", ":=", "strings", ".", "NewReplacer", "(", "\"", "\"", ",", "\"", "\"", ...
// Label returns the header label for the specified string
[ "Label", "returns", "the", "header", "label", "for", "the", "specified", "string" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/formatter/custom.go#L30-L36
159,862
docker/cli
cli/command/volume/cmd.go
NewVolumeCommand
func NewVolumeCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "volume COMMAND", Short: "Manage volumes", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{"version": "1.21"}, } cmd.AddCommand( newCreateCommand...
go
func NewVolumeCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "volume COMMAND", Short: "Manage volumes", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{"version": "1.21"}, } cmd.AddCommand( newCreateCommand...
[ "func", "NewVolumeCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Args", ":", "cli", ".", "NoArg...
// NewVolumeCommand returns a cobra command for `volume` subcommands
[ "NewVolumeCommand", "returns", "a", "cobra", "command", "for", "volume", "subcommands" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/volume/cmd.go#L10-L26
159,863
docker/cli
opts/config.go
Set
func (o *ConfigOpt) Set(value string) error { csvReader := csv.NewReader(strings.NewReader(value)) fields, err := csvReader.Read() if err != nil { return err } options := &swarmtypes.ConfigReference{ File: &swarmtypes.ConfigReferenceFileTarget{ UID: "0", GID: "0", Mode: 0444, }, } // support a...
go
func (o *ConfigOpt) Set(value string) error { csvReader := csv.NewReader(strings.NewReader(value)) fields, err := csvReader.Read() if err != nil { return err } options := &swarmtypes.ConfigReference{ File: &swarmtypes.ConfigReferenceFileTarget{ UID: "0", GID: "0", Mode: 0444, }, } // support a...
[ "func", "(", "o", "*", "ConfigOpt", ")", "Set", "(", "value", "string", ")", "error", "{", "csvReader", ":=", "csv", ".", "NewReader", "(", "strings", ".", "NewReader", "(", "value", ")", ")", "\n", "fields", ",", "err", ":=", "csvReader", ".", "Read...
// Set a new config value
[ "Set", "a", "new", "config", "value" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/opts/config.go#L19-L78
159,864
docker/cli
cli/command/stack/kubernetes/watcher.go
Watch
func (w *deployWatcher) Watch(name string, serviceNames []string, statusUpdates chan serviceStatus) error { errC := make(chan error, 1) defer close(errC) handlers := runtimeutil.ErrorHandlers // informer errors are reported using global error handlers runtimeutil.ErrorHandlers = append(handlers, func(err error) ...
go
func (w *deployWatcher) Watch(name string, serviceNames []string, statusUpdates chan serviceStatus) error { errC := make(chan error, 1) defer close(errC) handlers := runtimeutil.ErrorHandlers // informer errors are reported using global error handlers runtimeutil.ErrorHandlers = append(handlers, func(err error) ...
[ "func", "(", "w", "*", "deployWatcher", ")", "Watch", "(", "name", "string", ",", "serviceNames", "[", "]", "string", ",", "statusUpdates", "chan", "serviceStatus", ")", "error", "{", "errC", ":=", "make", "(", "chan", "error", ",", "1", ")", "\n", "de...
// Watch watches a stuck deployement and return a chan that will holds the state of the stack
[ "Watch", "watches", "a", "stuck", "deployement", "and", "return", "a", "chan", "that", "will", "holds", "the", "state", "of", "the", "stack" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/kubernetes/watcher.go#L38-L69
159,865
docker/cli
cli/context/store/storeconfig.go
EndpointTypeGetter
func EndpointTypeGetter(name string, getter TypeGetter) NamedTypeGetter { return NamedTypeGetter{ name: name, typeGetter: getter, } }
go
func EndpointTypeGetter(name string, getter TypeGetter) NamedTypeGetter { return NamedTypeGetter{ name: name, typeGetter: getter, } }
[ "func", "EndpointTypeGetter", "(", "name", "string", ",", "getter", "TypeGetter", ")", "NamedTypeGetter", "{", "return", "NamedTypeGetter", "{", "name", ":", "name", ",", "typeGetter", ":", "getter", ",", "}", "\n", "}" ]
// EndpointTypeGetter returns a NamedTypeGetter with the spcecified name and getter
[ "EndpointTypeGetter", "returns", "a", "NamedTypeGetter", "with", "the", "spcecified", "name", "and", "getter" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/context/store/storeconfig.go#L15-L20
159,866
docker/cli
cli/context/store/storeconfig.go
SetEndpoint
func (c Config) SetEndpoint(name string, getter TypeGetter) { c.endpointTypes[name] = getter }
go
func (c Config) SetEndpoint(name string, getter TypeGetter) { c.endpointTypes[name] = getter }
[ "func", "(", "c", "Config", ")", "SetEndpoint", "(", "name", "string", ",", "getter", "TypeGetter", ")", "{", "c", ".", "endpointTypes", "[", "name", "]", "=", "getter", "\n", "}" ]
// SetEndpoint set an endpoint typing information
[ "SetEndpoint", "set", "an", "endpoint", "typing", "information" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/context/store/storeconfig.go#L29-L31
159,867
docker/cli
cli/context/store/storeconfig.go
NewConfig
func NewConfig(contextType TypeGetter, endpoints ...NamedTypeGetter) Config { res := Config{ contextType: contextType, endpointTypes: make(map[string]TypeGetter), } for _, e := range endpoints { res.endpointTypes[e.name] = e.typeGetter } return res }
go
func NewConfig(contextType TypeGetter, endpoints ...NamedTypeGetter) Config { res := Config{ contextType: contextType, endpointTypes: make(map[string]TypeGetter), } for _, e := range endpoints { res.endpointTypes[e.name] = e.typeGetter } return res }
[ "func", "NewConfig", "(", "contextType", "TypeGetter", ",", "endpoints", "...", "NamedTypeGetter", ")", "Config", "{", "res", ":=", "Config", "{", "contextType", ":", "contextType", ",", "endpointTypes", ":", "make", "(", "map", "[", "string", "]", "TypeGetter...
// NewConfig creates a config object
[ "NewConfig", "creates", "a", "config", "object" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/context/store/storeconfig.go#L34-L43
159,868
docker/cli
cli/command/swarm/cmd.go
NewSwarmCommand
func NewSwarmCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "swarm", Short: "Manage Swarm", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{ "version": "1.24", "swarm": "", }, } cmd.AddCommand( newInitCommand(dockerCli),...
go
func NewSwarmCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "swarm", Short: "Manage Swarm", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{ "version": "1.24", "swarm": "", }, } cmd.AddCommand( newInitCommand(dockerCli),...
[ "func", "NewSwarmCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Args", ":", "cli", ".", "NoArgs...
// NewSwarmCommand returns a cobra command for `swarm` subcommands
[ "NewSwarmCommand", "returns", "a", "cobra", "command", "for", "swarm", "subcommands" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/swarm/cmd.go#L11-L33
159,869
docker/cli
cli/command/trust/inspect_pretty.go
printSignatures
func printSignatures(out io.Writer, signatureRows []trustTagRow) error { trustTagCtx := formatter.Context{ Output: out, Format: NewTrustTagFormat(), } // convert the formatted type before printing formattedTags := []SignedTagInfo{} for _, sigRow := range signatureRows { formattedSigners := sigRow.Signers i...
go
func printSignatures(out io.Writer, signatureRows []trustTagRow) error { trustTagCtx := formatter.Context{ Output: out, Format: NewTrustTagFormat(), } // convert the formatted type before printing formattedTags := []SignedTagInfo{} for _, sigRow := range signatureRows { formattedSigners := sigRow.Signers i...
[ "func", "printSignatures", "(", "out", "io", ".", "Writer", ",", "signatureRows", "[", "]", "trustTagRow", ")", "error", "{", "trustTagCtx", ":=", "formatter", ".", "Context", "{", "Output", ":", "out", ",", "Format", ":", "NewTrustTagFormat", "(", ")", ",...
// pretty print with ordered rows
[ "pretty", "print", "with", "ordered", "rows" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/trust/inspect_pretty.go#L55-L74
159,870
docker/cli
cli/command/formatter/formatter.go
Contains
func (f Format) Contains(sub string) bool { return strings.Contains(string(f), sub) }
go
func (f Format) Contains(sub string) bool { return strings.Contains(string(f), sub) }
[ "func", "(", "f", "Format", ")", "Contains", "(", "sub", "string", ")", "bool", "{", "return", "strings", ".", "Contains", "(", "string", "(", "f", ")", ",", "sub", ")", "\n", "}" ]
// Contains returns true if the format contains the substring
[ "Contains", "returns", "true", "if", "the", "format", "contains", "the", "substring" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/formatter/formatter.go#L32-L34
159,871
docker/cli
cli/command/formatter/formatter.go
Write
func (c *Context) Write(sub SubContext, f SubFormat) error { c.buffer = bytes.NewBufferString("") c.preFormat() tmpl, err := c.parseFormat() if err != nil { return err } subFormat := func(subContext SubContext) error { return c.contextFormat(tmpl, subContext) } if err := f(subFormat); err != nil { retur...
go
func (c *Context) Write(sub SubContext, f SubFormat) error { c.buffer = bytes.NewBufferString("") c.preFormat() tmpl, err := c.parseFormat() if err != nil { return err } subFormat := func(subContext SubContext) error { return c.contextFormat(tmpl, subContext) } if err := f(subFormat); err != nil { retur...
[ "func", "(", "c", "*", "Context", ")", "Write", "(", "sub", "SubContext", ",", "f", "SubFormat", ")", "error", "{", "c", ".", "buffer", "=", "bytes", ".", "NewBufferString", "(", "\"", "\"", ")", "\n", "c", ".", "preFormat", "(", ")", "\n\n", "tmpl...
// Write the template to the buffer using this Context
[ "Write", "the", "template", "to", "the", "buffer", "using", "this", "Context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/formatter/formatter.go#L101-L119
159,872
docker/cli
cli/command/stack/swarm/ps.go
RunPS
func RunPS(dockerCli command.Cli, opts options.PS) error { filter := getStackFilterFromOpt(opts.Namespace, opts.Filter) ctx := context.Background() client := dockerCli.Client() tasks, err := client.TaskList(ctx, types.TaskListOptions{Filters: filter}) if err != nil { return err } if len(tasks) == 0 { retur...
go
func RunPS(dockerCli command.Cli, opts options.PS) error { filter := getStackFilterFromOpt(opts.Namespace, opts.Filter) ctx := context.Background() client := dockerCli.Client() tasks, err := client.TaskList(ctx, types.TaskListOptions{Filters: filter}) if err != nil { return err } if len(tasks) == 0 { retur...
[ "func", "RunPS", "(", "dockerCli", "command", ".", "Cli", ",", "opts", "options", ".", "PS", ")", "error", "{", "filter", ":=", "getStackFilterFromOpt", "(", "opts", ".", "Namespace", ",", "opts", ".", "Filter", ")", "\n\n", "ctx", ":=", "context", ".", ...
// RunPS is the swarm implementation of docker stack ps
[ "RunPS", "is", "the", "swarm", "implementation", "of", "docker", "stack", "ps" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/ps.go#L15-L35
159,873
docker/cli
cli/command/engine/licenses.go
NewSubscriptionsFormat
func NewSubscriptionsFormat(source string, quiet bool) formatter.Format { switch source { case formatter.TableFormatKey: if quiet { return defaultSubscriptionsQuietFormat } return defaultSubscriptionsTableFormat case formatter.RawFormatKey: if quiet { return `license: {{.ID}}` } return `license: {{...
go
func NewSubscriptionsFormat(source string, quiet bool) formatter.Format { switch source { case formatter.TableFormatKey: if quiet { return defaultSubscriptionsQuietFormat } return defaultSubscriptionsTableFormat case formatter.RawFormatKey: if quiet { return `license: {{.ID}}` } return `license: {{...
[ "func", "NewSubscriptionsFormat", "(", "source", "string", ",", "quiet", "bool", ")", "formatter", ".", "Format", "{", "switch", "source", "{", "case", "formatter", ".", "TableFormatKey", ":", "if", "quiet", "{", "return", "defaultSubscriptionsQuietFormat", "\n", ...
// NewSubscriptionsFormat returns a Format for rendering using a license Context
[ "NewSubscriptionsFormat", "returns", "a", "Format", "for", "rendering", "using", "a", "license", "Context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/engine/licenses.go#L31-L45
159,874
docker/cli
cli/command/engine/licenses.go
SubscriptionsWrite
func SubscriptionsWrite(ctx formatter.Context, subs []licenseutils.LicenseDisplay) error { render := func(format func(subContext formatter.SubContext) error) error { for _, sub := range subs { licenseCtx := &licenseContext{trunc: ctx.Trunc, l: sub} if err := format(licenseCtx); err != nil { return err }...
go
func SubscriptionsWrite(ctx formatter.Context, subs []licenseutils.LicenseDisplay) error { render := func(format func(subContext formatter.SubContext) error) error { for _, sub := range subs { licenseCtx := &licenseContext{trunc: ctx.Trunc, l: sub} if err := format(licenseCtx); err != nil { return err }...
[ "func", "SubscriptionsWrite", "(", "ctx", "formatter", ".", "Context", ",", "subs", "[", "]", "licenseutils", ".", "LicenseDisplay", ")", "error", "{", "render", ":=", "func", "(", "format", "func", "(", "subContext", "formatter", ".", "SubContext", ")", "er...
// SubscriptionsWrite writes the context
[ "SubscriptionsWrite", "writes", "the", "context" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/engine/licenses.go#L48-L75
159,875
docker/cli
cli/cobra.go
setupCommonRootCommand
func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet, *cobra.Command) { opts := cliflags.NewClientOptions() flags := rootCmd.Flags() flags.StringVar(&opts.ConfigDir, "config", cliconfig.Dir(), "Location of client config files") opts.Common.InstallFlags(flags) cobra.AddTemp...
go
func setupCommonRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet, *cobra.Command) { opts := cliflags.NewClientOptions() flags := rootCmd.Flags() flags.StringVar(&opts.ConfigDir, "config", cliconfig.Dir(), "Location of client config files") opts.Common.InstallFlags(flags) cobra.AddTemp...
[ "func", "setupCommonRootCommand", "(", "rootCmd", "*", "cobra", ".", "Command", ")", "(", "*", "cliflags", ".", "ClientOptions", ",", "*", "pflag", ".", "FlagSet", ",", "*", "cobra", ".", "Command", ")", "{", "opts", ":=", "cliflags", ".", "NewClientOption...
// setupCommonRootCommand contains the setup common to // SetupRootCommand and SetupPluginRootCommand.
[ "setupCommonRootCommand", "contains", "the", "setup", "common", "to", "SetupRootCommand", "and", "SetupPluginRootCommand", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L20-L50
159,876
docker/cli
cli/cobra.go
SetupPluginRootCommand
func SetupPluginRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet) { opts, flags, _ := setupCommonRootCommand(rootCmd) return opts, flags }
go
func SetupPluginRootCommand(rootCmd *cobra.Command) (*cliflags.ClientOptions, *pflag.FlagSet) { opts, flags, _ := setupCommonRootCommand(rootCmd) return opts, flags }
[ "func", "SetupPluginRootCommand", "(", "rootCmd", "*", "cobra", ".", "Command", ")", "(", "*", "cliflags", ".", "ClientOptions", ",", "*", "pflag", ".", "FlagSet", ")", "{", "opts", ",", "flags", ",", "_", ":=", "setupCommonRootCommand", "(", "rootCmd", ")...
// SetupPluginRootCommand sets default usage, help and error handling for a plugin root command.
[ "SetupPluginRootCommand", "sets", "default", "usage", "help", "and", "error", "handling", "for", "a", "plugin", "root", "command", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L63-L66
159,877
docker/cli
cli/cobra.go
NewTopLevelCommand
func NewTopLevelCommand(cmd *cobra.Command, dockerCli *command.DockerCli, opts *cliflags.ClientOptions, flags *pflag.FlagSet) *TopLevelCommand { return &TopLevelCommand{cmd, dockerCli, opts, flags, os.Args[1:]} }
go
func NewTopLevelCommand(cmd *cobra.Command, dockerCli *command.DockerCli, opts *cliflags.ClientOptions, flags *pflag.FlagSet) *TopLevelCommand { return &TopLevelCommand{cmd, dockerCli, opts, flags, os.Args[1:]} }
[ "func", "NewTopLevelCommand", "(", "cmd", "*", "cobra", ".", "Command", ",", "dockerCli", "*", "command", ".", "DockerCli", ",", "opts", "*", "cliflags", ".", "ClientOptions", ",", "flags", "*", "pflag", ".", "FlagSet", ")", "*", "TopLevelCommand", "{", "r...
// NewTopLevelCommand returns a new TopLevelCommand object
[ "NewTopLevelCommand", "returns", "a", "new", "TopLevelCommand", "object" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L97-L99
159,878
docker/cli
cli/cobra.go
SetFlag
func (tcmd *TopLevelCommand) SetFlag(name, value string) { tcmd.cmd.Flags().Set(name, value) }
go
func (tcmd *TopLevelCommand) SetFlag(name, value string) { tcmd.cmd.Flags().Set(name, value) }
[ "func", "(", "tcmd", "*", "TopLevelCommand", ")", "SetFlag", "(", "name", ",", "value", "string", ")", "{", "tcmd", ".", "cmd", ".", "Flags", "(", ")", ".", "Set", "(", "name", ",", "value", ")", "\n", "}" ]
// SetFlag sets a flag in the local flag set of the top-level command
[ "SetFlag", "sets", "a", "flag", "in", "the", "local", "flag", "set", "of", "the", "top", "-", "level", "command" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L108-L110
159,879
docker/cli
cli/cobra.go
Initialize
func (tcmd *TopLevelCommand) Initialize(ops ...command.InitializeOpt) error { tcmd.opts.Common.SetDefaultOptions(tcmd.flags) return tcmd.dockerCli.Initialize(tcmd.opts, ops...) }
go
func (tcmd *TopLevelCommand) Initialize(ops ...command.InitializeOpt) error { tcmd.opts.Common.SetDefaultOptions(tcmd.flags) return tcmd.dockerCli.Initialize(tcmd.opts, ops...) }
[ "func", "(", "tcmd", "*", "TopLevelCommand", ")", "Initialize", "(", "ops", "...", "command", ".", "InitializeOpt", ")", "error", "{", "tcmd", ".", "opts", ".", "Common", ".", "SetDefaultOptions", "(", "tcmd", ".", "flags", ")", "\n", "return", "tcmd", "...
// Initialize finalises global option parsing and initializes the docker client.
[ "Initialize", "finalises", "global", "option", "parsing", "and", "initializes", "the", "docker", "client", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L153-L156
159,880
docker/cli
cli/cobra.go
VisitAll
func VisitAll(root *cobra.Command, fn func(*cobra.Command)) { for _, cmd := range root.Commands() { VisitAll(cmd, fn) } fn(root) }
go
func VisitAll(root *cobra.Command, fn func(*cobra.Command)) { for _, cmd := range root.Commands() { VisitAll(cmd, fn) } fn(root) }
[ "func", "VisitAll", "(", "root", "*", "cobra", ".", "Command", ",", "fn", "func", "(", "*", "cobra", ".", "Command", ")", ")", "{", "for", "_", ",", "cmd", ":=", "range", "root", ".", "Commands", "(", ")", "{", "VisitAll", "(", "cmd", ",", "fn", ...
// VisitAll will traverse all commands from the root. // This is different from the VisitAll of cobra.Command where only parents // are checked.
[ "VisitAll", "will", "traverse", "all", "commands", "from", "the", "root", ".", "This", "is", "different", "from", "the", "VisitAll", "of", "cobra", ".", "Command", "where", "only", "parents", "are", "checked", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L161-L166
159,881
docker/cli
cli/cobra.go
DisableFlagsInUseLine
func DisableFlagsInUseLine(cmd *cobra.Command) { VisitAll(cmd, func(ccmd *cobra.Command) { // do not add a `[flags]` to the end of the usage line. ccmd.DisableFlagsInUseLine = true }) }
go
func DisableFlagsInUseLine(cmd *cobra.Command) { VisitAll(cmd, func(ccmd *cobra.Command) { // do not add a `[flags]` to the end of the usage line. ccmd.DisableFlagsInUseLine = true }) }
[ "func", "DisableFlagsInUseLine", "(", "cmd", "*", "cobra", ".", "Command", ")", "{", "VisitAll", "(", "cmd", ",", "func", "(", "ccmd", "*", "cobra", ".", "Command", ")", "{", "// do not add a `[flags]` to the end of the usage line.", "ccmd", ".", "DisableFlagsInUs...
// DisableFlagsInUseLine sets the DisableFlagsInUseLine flag on all // commands within the tree rooted at cmd.
[ "DisableFlagsInUseLine", "sets", "the", "DisableFlagsInUseLine", "flag", "on", "all", "commands", "within", "the", "tree", "rooted", "at", "cmd", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/cobra.go#L170-L175
159,882
docker/cli
cli/command/stack/swarm/deploy.go
RunDeploy
func RunDeploy(dockerCli command.Cli, opts options.Deploy, cfg *composetypes.Config) error { ctx := context.Background() if err := validateResolveImageFlag(dockerCli, &opts); err != nil { return err } return deployCompose(ctx, dockerCli, opts, cfg) }
go
func RunDeploy(dockerCli command.Cli, opts options.Deploy, cfg *composetypes.Config) error { ctx := context.Background() if err := validateResolveImageFlag(dockerCli, &opts); err != nil { return err } return deployCompose(ctx, dockerCli, opts, cfg) }
[ "func", "RunDeploy", "(", "dockerCli", "command", ".", "Cli", ",", "opts", "options", ".", "Deploy", ",", "cfg", "*", "composetypes", ".", "Config", ")", "error", "{", "ctx", ":=", "context", ".", "Background", "(", ")", "\n\n", "if", "err", ":=", "val...
// RunDeploy is the swarm implementation of docker stack deploy
[ "RunDeploy", "is", "the", "swarm", "implementation", "of", "docker", "stack", "deploy" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/deploy.go#L25-L33
159,883
docker/cli
cli/command/stack/swarm/deploy.go
validateResolveImageFlag
func validateResolveImageFlag(dockerCli command.Cli, opts *options.Deploy) error { if opts.ResolveImage != ResolveImageAlways && opts.ResolveImage != ResolveImageChanged && opts.ResolveImage != ResolveImageNever { return errors.Errorf("Invalid option %s for flag --resolve-image", opts.ResolveImage) } // client sid...
go
func validateResolveImageFlag(dockerCli command.Cli, opts *options.Deploy) error { if opts.ResolveImage != ResolveImageAlways && opts.ResolveImage != ResolveImageChanged && opts.ResolveImage != ResolveImageNever { return errors.Errorf("Invalid option %s for flag --resolve-image", opts.ResolveImage) } // client sid...
[ "func", "validateResolveImageFlag", "(", "dockerCli", "command", ".", "Cli", ",", "opts", "*", "options", ".", "Deploy", ")", "error", "{", "if", "opts", ".", "ResolveImage", "!=", "ResolveImageAlways", "&&", "opts", ".", "ResolveImage", "!=", "ResolveImageChang...
// validateResolveImageFlag validates the opts.resolveImage command line option // and also turns image resolution off if the version is older than 1.30
[ "validateResolveImageFlag", "validates", "the", "opts", ".", "resolveImage", "command", "line", "option", "and", "also", "turns", "image", "resolution", "off", "if", "the", "version", "is", "older", "than", "1", ".", "30" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/deploy.go#L37-L47
159,884
docker/cli
cli/command/stack/swarm/deploy.go
checkDaemonIsSwarmManager
func checkDaemonIsSwarmManager(ctx context.Context, dockerCli command.Cli) error { info, err := dockerCli.Client().Info(ctx) if err != nil { return err } if !info.Swarm.ControlAvailable { return errors.New("this node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node...
go
func checkDaemonIsSwarmManager(ctx context.Context, dockerCli command.Cli) error { info, err := dockerCli.Client().Info(ctx) if err != nil { return err } if !info.Swarm.ControlAvailable { return errors.New("this node is not a swarm manager. Use \"docker swarm init\" or \"docker swarm join\" to connect this node...
[ "func", "checkDaemonIsSwarmManager", "(", "ctx", "context", ".", "Context", ",", "dockerCli", "command", ".", "Cli", ")", "error", "{", "info", ",", "err", ":=", "dockerCli", ".", "Client", "(", ")", ".", "Info", "(", "ctx", ")", "\n", "if", "err", "!=...
// checkDaemonIsSwarmManager does an Info API call to verify that the daemon is // a swarm manager. This is necessary because we must create networks before we // create services, but the API call for creating a network does not return a // proper status code when it can't create a network in the "global" scope.
[ "checkDaemonIsSwarmManager", "does", "an", "Info", "API", "call", "to", "verify", "that", "the", "daemon", "is", "a", "swarm", "manager", ".", "This", "is", "necessary", "because", "we", "must", "create", "networks", "before", "we", "create", "services", "but"...
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/deploy.go#L53-L62
159,885
docker/cli
cli/command/stack/swarm/deploy.go
pruneServices
func pruneServices(ctx context.Context, dockerCli command.Cli, namespace convert.Namespace, services map[string]struct{}) { client := dockerCli.Client() oldServices, err := getStackServices(ctx, client, namespace.Name()) if err != nil { fmt.Fprintf(dockerCli.Err(), "Failed to list services: %s\n", err) } prune...
go
func pruneServices(ctx context.Context, dockerCli command.Cli, namespace convert.Namespace, services map[string]struct{}) { client := dockerCli.Client() oldServices, err := getStackServices(ctx, client, namespace.Name()) if err != nil { fmt.Fprintf(dockerCli.Err(), "Failed to list services: %s\n", err) } prune...
[ "func", "pruneServices", "(", "ctx", "context", ".", "Context", ",", "dockerCli", "command", ".", "Cli", ",", "namespace", "convert", ".", "Namespace", ",", "services", "map", "[", "string", "]", "struct", "{", "}", ")", "{", "client", ":=", "dockerCli", ...
// pruneServices removes services that are no longer referenced in the source
[ "pruneServices", "removes", "services", "that", "are", "no", "longer", "referenced", "in", "the", "source" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/stack/swarm/deploy.go#L65-L80
159,886
docker/cli
opts/network.go
Set
func (n *NetworkOpt) Set(value string) error { longSyntax, err := regexp.MatchString(`\w+=\w+(,\w+=\w+)*`, value) if err != nil { return err } var netOpt NetworkAttachmentOpts if longSyntax { csvReader := csv.NewReader(strings.NewReader(value)) fields, err := csvReader.Read() if err != nil { return err...
go
func (n *NetworkOpt) Set(value string) error { longSyntax, err := regexp.MatchString(`\w+=\w+(,\w+=\w+)*`, value) if err != nil { return err } var netOpt NetworkAttachmentOpts if longSyntax { csvReader := csv.NewReader(strings.NewReader(value)) fields, err := csvReader.Read() if err != nil { return err...
[ "func", "(", "n", "*", "NetworkOpt", ")", "Set", "(", "value", "string", ")", "error", "{", "longSyntax", ",", "err", ":=", "regexp", ".", "MatchString", "(", "`\\w+=\\w+(,\\w+=\\w+)*`", ",", "value", ")", "\n", "if", "err", "!=", "nil", "{", "return", ...
// Set networkopts value
[ "Set", "networkopts", "value" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/opts/network.go#L33-L85
159,887
docker/cli
opts/network.go
NetworkMode
func (n *NetworkOpt) NetworkMode() string { networkIDOrName := "default" netOptVal := n.Value() if len(netOptVal) > 0 { networkIDOrName = netOptVal[0].Target } return networkIDOrName }
go
func (n *NetworkOpt) NetworkMode() string { networkIDOrName := "default" netOptVal := n.Value() if len(netOptVal) > 0 { networkIDOrName = netOptVal[0].Target } return networkIDOrName }
[ "func", "(", "n", "*", "NetworkOpt", ")", "NetworkMode", "(", ")", "string", "{", "networkIDOrName", ":=", "\"", "\"", "\n", "netOptVal", ":=", "n", ".", "Value", "(", ")", "\n", "if", "len", "(", "netOptVal", ")", ">", "0", "{", "networkIDOrName", "...
// NetworkMode return the network mode for the network option
[ "NetworkMode", "return", "the", "network", "mode", "for", "the", "network", "option" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/opts/network.go#L103-L110
159,888
docker/cli
cli/command/secret/cmd.go
NewSecretCommand
func NewSecretCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "secret", Short: "Manage Docker secrets", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{ "version": "1.25", "swarm": "", }, } cmd.AddCommand( newSecretListCo...
go
func NewSecretCommand(dockerCli command.Cli) *cobra.Command { cmd := &cobra.Command{ Use: "secret", Short: "Manage Docker secrets", Args: cli.NoArgs, RunE: command.ShowHelp(dockerCli.Err()), Annotations: map[string]string{ "version": "1.25", "swarm": "", }, } cmd.AddCommand( newSecretListCo...
[ "func", "NewSecretCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\"", ",", "Args", ":", "cli", ".", "NoArg...
// NewSecretCommand returns a cobra command for `secret` subcommands
[ "NewSecretCommand", "returns", "a", "cobra", "command", "for", "secret", "subcommands" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/secret/cmd.go#L11-L29
159,889
docker/cli
cli/trust/trust.go
certificateDirectory
func certificateDirectory(server string) (string, error) { u, err := url.Parse(server) if err != nil { return "", err } return filepath.Join(cliconfig.Dir(), "tls", u.Host), nil }
go
func certificateDirectory(server string) (string, error) { u, err := url.Parse(server) if err != nil { return "", err } return filepath.Join(cliconfig.Dir(), "tls", u.Host), nil }
[ "func", "certificateDirectory", "(", "server", "string", ")", "(", "string", ",", "error", ")", "{", "u", ",", "err", ":=", "url", ".", "Parse", "(", "server", ")", "\n", "if", "err", "!=", "nil", "{", "return", "\"", "\"", ",", "err", "\n", "}", ...
// certificateDirectory returns the directory containing // TLS certificates for the given server. An error is // returned if there was an error parsing the server string.
[ "certificateDirectory", "returns", "the", "directory", "containing", "TLS", "certificates", "for", "the", "given", "server", ".", "An", "error", "is", "returned", "if", "there", "was", "an", "error", "parsing", "the", "server", "string", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L56-L63
159,890
docker/cli
cli/trust/trust.go
Server
func Server(index *registrytypes.IndexInfo) (string, error) { if s := os.Getenv("DOCKER_CONTENT_TRUST_SERVER"); s != "" { urlObj, err := url.Parse(s) if err != nil || urlObj.Scheme != "https" { return "", errors.Errorf("valid https URL required for trust server, got %s", s) } return s, nil } if index.Off...
go
func Server(index *registrytypes.IndexInfo) (string, error) { if s := os.Getenv("DOCKER_CONTENT_TRUST_SERVER"); s != "" { urlObj, err := url.Parse(s) if err != nil || urlObj.Scheme != "https" { return "", errors.Errorf("valid https URL required for trust server, got %s", s) } return s, nil } if index.Off...
[ "func", "Server", "(", "index", "*", "registrytypes", ".", "IndexInfo", ")", "(", "string", ",", "error", ")", "{", "if", "s", ":=", "os", ".", "Getenv", "(", "\"", "\"", ")", ";", "s", "!=", "\"", "\"", "{", "urlObj", ",", "err", ":=", "url", ...
// Server returns the base URL for the trust server.
[ "Server", "returns", "the", "base", "URL", "for", "the", "trust", "server", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L66-L79
159,891
docker/cli
cli/trust/trust.go
GetNotaryRepository
func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo *registry.RepositoryInfo, authConfig *types.AuthConfig, actions ...string) (client.Repository, error) { server, err := Server(repoInfo.Index) if err != nil { return nil, err } var cfg = tlsconfig.ClientDefault() cfg.InsecureSkipVer...
go
func GetNotaryRepository(in io.Reader, out io.Writer, userAgent string, repoInfo *registry.RepositoryInfo, authConfig *types.AuthConfig, actions ...string) (client.Repository, error) { server, err := Server(repoInfo.Index) if err != nil { return nil, err } var cfg = tlsconfig.ClientDefault() cfg.InsecureSkipVer...
[ "func", "GetNotaryRepository", "(", "in", "io", ".", "Reader", ",", "out", "io", ".", "Writer", ",", "userAgent", "string", ",", "repoInfo", "*", "registry", ".", "RepositoryInfo", ",", "authConfig", "*", "types", ".", "AuthConfig", ",", "actions", "...", ...
// GetNotaryRepository returns a NotaryRepository which stores all the // information needed to operate on a notary repository. // It creates an HTTP transport providing authentication support.
[ "GetNotaryRepository", "returns", "a", "NotaryRepository", "which", "stores", "all", "the", "information", "needed", "to", "operate", "on", "a", "notary", "repository", ".", "It", "creates", "an", "HTTP", "transport", "providing", "authentication", "support", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L99-L184
159,892
docker/cli
cli/trust/trust.go
GetPassphraseRetriever
func GetPassphraseRetriever(in io.Reader, out io.Writer) notary.PassRetriever { aliasMap := map[string]string{ "root": "root", "snapshot": "repository", "targets": "repository", "default": "repository", } baseRetriever := passphrase.PromptRetrieverWithInOut(in, out, aliasMap) env := map[string]string{...
go
func GetPassphraseRetriever(in io.Reader, out io.Writer) notary.PassRetriever { aliasMap := map[string]string{ "root": "root", "snapshot": "repository", "targets": "repository", "default": "repository", } baseRetriever := passphrase.PromptRetrieverWithInOut(in, out, aliasMap) env := map[string]string{...
[ "func", "GetPassphraseRetriever", "(", "in", "io", ".", "Reader", ",", "out", "io", ".", "Writer", ")", "notary", ".", "PassRetriever", "{", "aliasMap", ":=", "map", "[", "string", "]", "string", "{", "\"", "\"", ":", "\"", "\"", ",", "\"", "\"", ":"...
// GetPassphraseRetriever returns a passphrase retriever that utilizes Content Trust env vars
[ "GetPassphraseRetriever", "returns", "a", "passphrase", "retriever", "that", "utilizes", "Content", "Trust", "env", "vars" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L187-L212
159,893
docker/cli
cli/trust/trust.go
NotaryError
func NotaryError(repoName string, err error) error { switch err.(type) { case *json.SyntaxError: logrus.Debugf("Notary syntax error: %s", err) return errors.Errorf("Error: no trust data available for remote repository %s. Try running notary server and setting DOCKER_CONTENT_TRUST_SERVER to its HTTPS address?", re...
go
func NotaryError(repoName string, err error) error { switch err.(type) { case *json.SyntaxError: logrus.Debugf("Notary syntax error: %s", err) return errors.Errorf("Error: no trust data available for remote repository %s. Try running notary server and setting DOCKER_CONTENT_TRUST_SERVER to its HTTPS address?", re...
[ "func", "NotaryError", "(", "repoName", "string", ",", "err", "error", ")", "error", "{", "switch", "err", ".", "(", "type", ")", "{", "case", "*", "json", ".", "SyntaxError", ":", "logrus", ".", "Debugf", "(", "\"", "\"", ",", "err", ")", "\n", "r...
// NotaryError formats an error message received from the notary service
[ "NotaryError", "formats", "an", "error", "message", "received", "from", "the", "notary", "service" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L215-L243
159,894
docker/cli
cli/trust/trust.go
GetSignableRoles
func GetSignableRoles(repo client.Repository, target *client.Target) ([]data.RoleName, error) { var signableRoles []data.RoleName // translate the full key names, which includes the GUN, into just the key IDs allCanonicalKeyIDs := make(map[string]struct{}) for fullKeyID := range repo.GetCryptoService().ListAllKeys...
go
func GetSignableRoles(repo client.Repository, target *client.Target) ([]data.RoleName, error) { var signableRoles []data.RoleName // translate the full key names, which includes the GUN, into just the key IDs allCanonicalKeyIDs := make(map[string]struct{}) for fullKeyID := range repo.GetCryptoService().ListAllKeys...
[ "func", "GetSignableRoles", "(", "repo", "client", ".", "Repository", ",", "target", "*", "client", ".", "Target", ")", "(", "[", "]", "data", ".", "RoleName", ",", "error", ")", "{", "var", "signableRoles", "[", "]", "data", ".", "RoleName", "\n\n", "...
// GetSignableRoles returns a list of roles for which we have valid signing // keys, given a notary repository and a target
[ "GetSignableRoles", "returns", "a", "list", "of", "roles", "for", "which", "we", "have", "valid", "signing", "keys", "given", "a", "notary", "repository", "and", "a", "target" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L247-L291
159,895
docker/cli
cli/trust/trust.go
GetImageReferencesAndAuth
func GetImageReferencesAndAuth(ctx context.Context, rs registry.Service, authResolver func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig, imgName string, ) (ImageRefAndAuth, error) { ref, err := reference.ParseNormalizedNamed(imgName) if err != nil { return ImageRefAndAuth{}, err } // R...
go
func GetImageReferencesAndAuth(ctx context.Context, rs registry.Service, authResolver func(ctx context.Context, index *registrytypes.IndexInfo) types.AuthConfig, imgName string, ) (ImageRefAndAuth, error) { ref, err := reference.ParseNormalizedNamed(imgName) if err != nil { return ImageRefAndAuth{}, err } // R...
[ "func", "GetImageReferencesAndAuth", "(", "ctx", "context", ".", "Context", ",", "rs", "registry", ".", "Service", ",", "authResolver", "func", "(", "ctx", "context", ".", "Context", ",", "index", "*", "registrytypes", ".", "IndexInfo", ")", "types", ".", "A...
// GetImageReferencesAndAuth retrieves the necessary reference and auth information for an image name // as an ImageRefAndAuth struct
[ "GetImageReferencesAndAuth", "retrieves", "the", "necessary", "reference", "and", "auth", "information", "for", "an", "image", "name", "as", "an", "ImageRefAndAuth", "struct" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/trust/trust.go#L305-L335
159,896
docker/cli
cli/command/swarm/opts.go
Set
func (a *NodeAddrOption) Set(value string) error { addr, err := opts.ParseTCPAddr(value, a.addr) if err != nil { return err } a.addr = addr return nil }
go
func (a *NodeAddrOption) Set(value string) error { addr, err := opts.ParseTCPAddr(value, a.addr) if err != nil { return err } a.addr = addr return nil }
[ "func", "(", "a", "*", "NodeAddrOption", ")", "Set", "(", "value", "string", ")", "error", "{", "addr", ",", "err", ":=", "opts", ".", "ParseTCPAddr", "(", "value", ",", "a", ".", "addr", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", ...
// Set the value for this flag
[ "Set", "the", "value", "for", "this", "flag" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/swarm/opts.go#L61-L68
159,897
docker/cli
cli/command/swarm/opts.go
String
func (m *ExternalCAOption) String() string { externalCAs := []string{} for _, externalCA := range m.values { repr := fmt.Sprintf("%s: %s", externalCA.Protocol, externalCA.URL) externalCAs = append(externalCAs, repr) } return strings.Join(externalCAs, ", ") }
go
func (m *ExternalCAOption) String() string { externalCAs := []string{} for _, externalCA := range m.values { repr := fmt.Sprintf("%s: %s", externalCA.Protocol, externalCA.URL) externalCAs = append(externalCAs, repr) } return strings.Join(externalCAs, ", ") }
[ "func", "(", "m", "*", "ExternalCAOption", ")", "String", "(", ")", "string", "{", "externalCAs", ":=", "[", "]", "string", "{", "}", "\n", "for", "_", ",", "externalCA", ":=", "range", "m", ".", "values", "{", "repr", ":=", "fmt", ".", "Sprintf", ...
// String returns a string repr of this option.
[ "String", "returns", "a", "string", "repr", "of", "this", "option", "." ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/swarm/opts.go#L112-L119
159,898
docker/cli
cli/command/swarm/opts.go
Set
func (p *PEMFile) Set(value string) error { contents, err := ioutil.ReadFile(value) if err != nil { return err } if pemBlock, _ := pem.Decode(contents); pemBlock == nil { return errors.New("file contents must be in PEM format") } p.contents, p.path = string(contents), value return nil }
go
func (p *PEMFile) Set(value string) error { contents, err := ioutil.ReadFile(value) if err != nil { return err } if pemBlock, _ := pem.Decode(contents); pemBlock == nil { return errors.New("file contents must be in PEM format") } p.contents, p.path = string(contents), value return nil }
[ "func", "(", "p", "*", "PEMFile", ")", "Set", "(", "value", "string", ")", "error", "{", "contents", ",", "err", ":=", "ioutil", ".", "ReadFile", "(", "value", ")", "\n", "if", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n", "if", "pem...
// Set parses a root rotation option
[ "Set", "parses", "a", "root", "rotation", "option" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/swarm/opts.go#L142-L152
159,899
docker/cli
cli/command/manifest/annotate.go
newAnnotateCommand
func newAnnotateCommand(dockerCli command.Cli) *cobra.Command { var opts annotateOptions cmd := &cobra.Command{ Use: "annotate [OPTIONS] MANIFEST_LIST MANIFEST", Short: "Add additional information to a local image manifest", Args: cli.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { ...
go
func newAnnotateCommand(dockerCli command.Cli) *cobra.Command { var opts annotateOptions cmd := &cobra.Command{ Use: "annotate [OPTIONS] MANIFEST_LIST MANIFEST", Short: "Add additional information to a local image manifest", Args: cli.ExactArgs(2), RunE: func(cmd *cobra.Command, args []string) error { ...
[ "func", "newAnnotateCommand", "(", "dockerCli", "command", ".", "Cli", ")", "*", "cobra", ".", "Command", "{", "var", "opts", "annotateOptions", "\n\n", "cmd", ":=", "&", "cobra", ".", "Command", "{", "Use", ":", "\"", "\"", ",", "Short", ":", "\"", "\...
// NewAnnotateCommand creates a new `docker manifest annotate` command
[ "NewAnnotateCommand", "creates", "a", "new", "docker", "manifest", "annotate", "command" ]
3273c2e23546dddd0ff8bb499f4aba02fe60bf30
https://github.com/docker/cli/blob/3273c2e23546dddd0ff8bb499f4aba02fe60bf30/cli/command/manifest/annotate.go#L24-L46