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

Function NewVolumeFormat

cli/command/formatter/volume.go:30–44  ·  view source on GitHub ↗

NewVolumeFormat returns a format for use with a volume Context

(source string, quiet bool)

Source from the content-addressed store, hash-verified

28
29// NewVolumeFormat returns a format for use with a volume Context
30func NewVolumeFormat(source string, quiet bool) Format {
31 switch source {
32 case TableFormatKey:
33 if quiet {
34 return defaultVolumeQuietFormat
35 }
36 return defaultVolumeTableFormat
37 case RawFormatKey:
38 if quiet {
39 return `name: {{.Name}}`
40 }
41 return `name: {{.Name}}\ndriver: {{.Driver}}\n`
42 }
43 return Format(source)
44}
45
46// VolumeWrite writes formatted volumes using the Context
47func VolumeWrite(ctx Context, volumes []volume.Volume) error {

Callers 2

TestVolumeContextWriteFunction · 0.85
NewDiskUsageFormatFunction · 0.85

Calls 1

FormatTypeAlias · 0.85

Tested by 1

TestVolumeContextWriteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…