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

Function stackWrite

cli/command/stack/list_formatter.go:19–36  ·  view source on GitHub ↗

stackWrite writes formatted stacks using the Context

(fmtCtx formatter.Context, stacks []stackSummary)

Source from the content-addressed store, hash-verified

17
18// stackWrite writes formatted stacks using the Context
19func stackWrite(fmtCtx formatter.Context, stacks []stackSummary) error {
20 stackCtx := &stackContext{
21 HeaderContext: formatter.HeaderContext{
22 Header: formatter.SubHeaderContext{
23 "Name": formatter.NameHeader,
24 "Services": "SERVICES",
25 },
26 },
27 }
28 return fmtCtx.Write(stackCtx, func(format func(subContext formatter.SubContext) error) error {
29 for _, stack := range stacks {
30 if err := format(&stackContext{s: stack}); err != nil {
31 return err
32 }
33 }
34 return nil
35 })
36}
37
38type stackContext struct {
39 formatter.HeaderContext

Callers 2

TestStackContextWriteFunction · 0.85
runListFunction · 0.85

Calls 2

formatFunction · 0.85
WriteMethod · 0.45

Tested by 1

TestStackContextWriteFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…