ContainerWrite renders the context for a list of containers
(ctx Context, containers []container.Summary)
| 80 | |
| 81 | // ContainerWrite renders the context for a list of containers |
| 82 | func ContainerWrite(ctx Context, containers []container.Summary) error { |
| 83 | return ctx.Write(NewContainerContext(), func(format func(subContext SubContext) error) error { |
| 84 | for _, ctr := range containers { |
| 85 | if err := format(&ContainerContext{trunc: ctx.Trunc, c: ctr}); err != nil { |
| 86 | return err |
| 87 | } |
| 88 | } |
| 89 | return nil |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | // ContainerContext is a struct used for rendering a list of containers in a Go template. |
| 94 | type ContainerContext struct { |
searching dependent graphs…