Documentation ¶
Index ¶
- func ContainerStatus(ctx context.Context, c containerd.Container) string
- func Ellipsis(str string, maxDisplayWidth int) string
- func FormatLabels(labelMap map[string]string) string
- func FormatPorts(labelMap map[string]string) string
- func FormatSlice(format string, writer io.Writer, x []interface{}) error
- func InspectContainerCommand(spec *oci.Spec, trunc, quote bool) string
- func InspectContainerCommandTrunc(spec *oci.Spec) string
- func ParseTemplate(format string) (*template.Template, error)
- func TimeSinceInHuman(since time.Time) string
- func ToJSON(i interface{}, prefix string, indentation string) (string, error)
- type Flusher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainerStatus ¶
func ContainerStatus(ctx context.Context, c containerd.Container) string
func FormatLabels ¶
func FormatPorts ¶
func FormatSlice ¶
FormatSlice formats the slice with `--format` flag.
--format="" (default): JSON --format='{{json .}}': JSON lines
FormatSlice is expected to be only used for `nerdctl OBJECT inspect` commands.
func InspectContainerCommand ¶
func ParseTemplate ¶
ParseTemplate wraps github.com/docker/cli/templates.Parse() to allow `json` as an alias of `{{json .}}`. ParseTemplate can be removed when https://github.com/docker/cli/pull/3355 gets merged and tagged (Docker 22.XX).
func TimeSinceInHuman ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.