{"modulePath":"github.com/docker/CLI","version":"v29.10.1+incompatible","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package inspect\n\n## Functions\n\n```go\nfunc Inspect(out io.Writer, references []string, tmplStr string, getRef GetRefFunc) error\n```\nInspect fetches objects by reference using GetRefFunc and writes the json representation to the output writer.\n\n## Types\n\n```go\ntype GetRefFunc func(ref string) (any, []byte, error)\n```\nGetRefFunc is a function which used by Inspect to fetch an object from a reference\n\n```go\ntype Inspector interface {\n\t// Inspect writes the raw element in JSON format.\n\tInspect(typedElement any, rawElement []byte) error\n\t// Flush writes the result of inspecting all elements into the output stream.\n\tFlush() error\n}\n```\nInspector defines an interface to implement to process elements\n\n```go\nfunc NewIndentedInspector(out io.Writer) Inspector\n```\nNewIndentedInspector generates a new inspector with an indented representation of elements.\n\n```go\nfunc NewJSONInspector(out io.Writer) Inspector\n```\nNewJSONInspector generates a new inspector with a compact representation of elements.\n\n```go\nfunc NewTemplateInspectorFromString(out io.Writer, tmplStr string) (Inspector, error)\n```\nNewTemplateInspectorFromString creates a new TemplateInspector from a string which is compiled into a template.\n\n```go\ntype TemplateInspector struct {\n\t// contains filtered or unexported fields\n}\n```\nTemplateInspector uses a text template to inspect elements.\n\n```go\nfunc NewTemplateInspector(out io.Writer, tmpl *template.Template) *TemplateInspector\n```\nNewTemplateInspector creates a new inspector with a template.\n\n```go\nfunc (i *TemplateInspector) Flush() error\n```\nFlush writes the result of inspecting all elements into the output stream.\n\n```go\nfunc (i *TemplateInspector) Inspect(typedElement any, rawElement []byte) error\n```\nInspect 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.\n\n","path":"github.com/docker/CLI/cli/command/inspect","name":"inspect","synopsis":"","isRedistributable":true}
