package inspect
import "github.com/docker/cli/cli/command/inspect"
Index ¶
- func Inspect(out io.Writer, references []string, tmplStr string, getRef GetRefFunc) error
- type GetRefFunc
- type Inspector
- func NewIndentedInspector(outputStream io.Writer) Inspector
- func NewJSONInspector(outputStream io.Writer) Inspector
- func NewTemplateInspector(outputStream io.Writer, tmpl *template.Template) Inspector
- func NewTemplateInspectorFromString(out io.Writer, tmplStr string) (Inspector, error)
- type TemplateInspector
Functions ¶
func Inspect ¶
Inspect fetches objects by reference using GetRefFunc and writes the json representation to the output writer.
Types ¶
type GetRefFunc ¶
GetRefFunc is a function which used by Inspect to fetch an object from a reference
type Inspector ¶
type Inspector interface { // Inspect writes the raw element in JSON format. Inspect(typedElement interface{}, rawElement []byte) error // Flush writes the result of inspecting all elements into the output stream. Flush() error }
Inspector defines an interface to implement to process elements
func NewIndentedInspector ¶
NewIndentedInspector generates a new inspector with an indented representation of elements.
func NewJSONInspector ¶
NewJSONInspector generates a new inspector with a compact representation of elements.
func NewTemplateInspector ¶
NewTemplateInspector creates a new inspector with a template.
func NewTemplateInspectorFromString ¶
NewTemplateInspectorFromString creates a new TemplateInspector from a string which is compiled into a template.
type TemplateInspector ¶
type TemplateInspector struct {
// contains filtered or unexported fields
}
TemplateInspector uses a text template to inspect elements.
func (*TemplateInspector) Flush ¶
func (i *TemplateInspector) Flush() error
Flush writes the result of inspecting all elements into the output stream.
func (*TemplateInspector) Inspect ¶
func (i *TemplateInspector) Inspect(typedElement interface{}, rawElement []byte) error
Inspect executes the inspect template. It decodes the raw element into a map if the initial execution fails. This allows docker cli to parse inspect structs injected with Swarm fields.
Source Files ¶
- Version
- v24.0.5+incompatible
- Published
- Jul 19, 2023
- Platform
- linux/amd64
- Imports
- 9 packages
- Last checked
- 45 seconds ago –
Tools for package owners.