newTaskFormat returns a Format for rendering using a taskContext.
(source string, quiet bool)
| 25 | |
| 26 | // newTaskFormat returns a Format for rendering using a taskContext. |
| 27 | func newTaskFormat(source string, quiet bool) formatter.Format { |
| 28 | switch source { |
| 29 | case formatter.TableFormatKey: |
| 30 | if quiet { |
| 31 | return formatter.DefaultQuietFormat |
| 32 | } |
| 33 | return defaultTaskTableFormat |
| 34 | case formatter.RawFormatKey: |
| 35 | if quiet { |
| 36 | return `id: {{.ID}}` |
| 37 | } |
| 38 | return `id: {{.ID}}\nname: {{.Name}}\nimage: {{.Image}}\nnode: {{.Node}}\ndesired_state: {{.DesiredState}}\ncurrent_state: {{.CurrentState}}\nerror: {{.Error}}\nports: {{.Ports}}\n` |
| 39 | } |
| 40 | return formatter.Format(source) |
| 41 | } |
| 42 | |
| 43 | // formatWrite writes the context. |
| 44 | func formatWrite(fmtCtx formatter.Context, tasks client.TaskListResult, names map[string]string, nodes map[string]string) error { |
no outgoing calls
searching dependent graphs…