ContainerWrite renders the context for a list of containers
(ctx formatter.Context, containers []api.ContainerSummary)
| 84 | |
| 85 | // ContainerWrite renders the context for a list of containers |
| 86 | func ContainerWrite(ctx formatter.Context, containers []api.ContainerSummary) error { |
| 87 | render := func(format func(subContext formatter.SubContext) error) error { |
| 88 | for _, container := range containers { |
| 89 | err := format(&ContainerContext{trunc: ctx.Trunc, c: container}) |
| 90 | if err != nil { |
| 91 | return err |
| 92 | } |
| 93 | } |
| 94 | return nil |
| 95 | } |
| 96 | return ctx.Write(NewContainerContext(), render) |
| 97 | } |
| 98 | |
| 99 | // ContainerContext is a struct used for rendering a list of containers in a Go template. |
| 100 | type ContainerContext struct { |
no test coverage detected