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

Function NewListFormat

cli/command/service/formatter.go:599–613  ·  view source on GitHub ↗

NewListFormat returns a Format for rendering using a service Context

(source string, quiet bool)

Source from the content-addressed store, hash-verified

597
598// NewListFormat returns a Format for rendering using a service Context
599func NewListFormat(source string, quiet bool) formatter.Format {
600 switch source {
601 case formatter.TableFormatKey:
602 if quiet {
603 return formatter.DefaultQuietFormat
604 }
605 return defaultServiceTableFormat
606 case formatter.RawFormatKey:
607 if quiet {
608 return `id: {{.ID}}`
609 }
610 return `id: {{.ID}}\nname: {{.Name}}\nmode: {{.Mode}}\nreplicas: {{.Replicas}}\nimage: {{.Image}}\nports: {{.Ports}}\n`
611 }
612 return formatter.Format(source)
613}
614
615// ListFormatWrite writes the context
616func ListFormatWrite(ctx formatter.Context, services client.ServiceListResult) error {

Callers 2

TestServiceContextWriteFunction · 0.85
runListFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestServiceContextWriteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…