MCPcopy Index your code
hub / github.com/docker/cli / WithUserAgent

Function WithUserAgent

cli/command/cli_options.go:229–237  ·  view source on GitHub ↗

WithUserAgent configures the User-Agent string for cli HTTP requests.

(userAgent string)

Source from the content-addressed store, hash-verified

227
228// WithUserAgent configures the User-Agent string for cli HTTP requests.
229func WithUserAgent(userAgent string) CLIOption {
230 return func(cli *DockerCli) error {
231 if userAgent == "" {
232 return errors.New("user agent cannot be blank")
233 }
234 cli.clientOpts = append(cli.clientOpts, client.WithUserAgent(userAgent))
235 return nil
236 }
237}

Callers 2

NewDockerCliFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…