newFormat returns a [formatter.Format] for rendering a networkContext.
(source string, quiet bool)
| 24 | |
| 25 | // newFormat returns a [formatter.Format] for rendering a networkContext. |
| 26 | func newFormat(source string, quiet bool) formatter.Format { |
| 27 | switch source { |
| 28 | case formatter.TableFormatKey: |
| 29 | if quiet { |
| 30 | return formatter.DefaultQuietFormat |
| 31 | } |
| 32 | return defaultNetworkTableFormat |
| 33 | case formatter.RawFormatKey: |
| 34 | if quiet { |
| 35 | return `network_id: {{.ID}}` |
| 36 | } |
| 37 | return `network_id: {{.ID}}\nname: {{.Name}}\ndriver: {{.Driver}}\nscope: {{.Scope}}\n` |
| 38 | } |
| 39 | return formatter.Format(source) |
| 40 | } |
| 41 | |
| 42 | // formatWrite writes the context. |
| 43 | func formatWrite(fmtCtx formatter.Context, networks client.NetworkListResult) error { |
no outgoing calls
searching dependent graphs…