MCPcopy Index your code
hub / github.com/docker/cli / ContainerWrite

Function ContainerWrite

cli/command/formatter/container.go:82–91  ·  view source on GitHub ↗

ContainerWrite renders the context for a list of containers

(ctx Context, containers []container.Summary)

Source from the content-addressed store, hash-verified

80
81// ContainerWrite renders the context for a list of containers
82func 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.
94type ContainerContext struct {

Calls 3

NewContainerContextFunction · 0.85
formatFunction · 0.85
WriteMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…