NewVolumeFormat returns a format for use with a volume Context
(source string, quiet bool)
| 28 | |
| 29 | // NewVolumeFormat returns a format for use with a volume Context |
| 30 | func 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 |
| 47 | func VolumeWrite(ctx Context, volumes []volume.Volume) error { |
searching dependent graphs…