NewListFormat returns a Format for rendering using a service Context
(source string, quiet bool)
| 597 | |
| 598 | // NewListFormat returns a Format for rendering using a service Context |
| 599 | func 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 |
| 616 | func ListFormatWrite(ctx formatter.Context, services client.ServiceListResult) error { |
no outgoing calls
searching dependent graphs…