formatter

package
v0.0.0-...-932d068 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableFormat = "table"
	RawFormat   = "raw"
)

Format key to output

Variables

View Source
var ContainerHeader = map[string]string{
	"Names":        "Name",
	"ID":           "ID",
	"Status":       "Status",
	"RunningFor":   "Created",
	"Image":        "Image",
	"Runtime":      "Runtime",
	"Command":      "Command",
	"ImageID":      "ImageID",
	"Labels":       "Labels",
	"Mounts":       "Mounts",
	"State":        "State",
	"Ports":        "Ports",
	"Size":         "Size",
	"LocalVolumes": "LocalVolumes",
	"Networks":     "Networks",
	"CreatedAt":    "CreatedAt",
}

ContainerHeader is the map to show container head

Functions

func IsTable

func IsTable(format string) bool

IsTable to verify if table or raw

func LabelsToString

func LabelsToString(labels map[string]string) string

LabelsToString is to transform the labels from map to string

func LocalVolumes

func LocalVolumes(mount []types.MountPoint) string

LocalVolumes is get the count of local volumes

func MountPointToString

func MountPointToString(mount []types.MountPoint) string

MountPointToString is to transform the MountPoint from array to string

func PortBindingsToString

func PortBindingsToString(portMap types.PortMap) string

PortBindingsToString is to transform the portbindings from map to string

func PreFormat

func PreFormat(format string) string

PreFormat is to format the format option

func SizeToString

func SizeToString(sizeRw int64, sizeRootFs int64) string

SizeToString is to get the size related output

Types

type ContainerContext

type ContainerContext map[string]string

ContainerContext is the map to show container context detail

func NewContainerContext

func NewContainerContext(c *types.Container, flagNoTrunc bool) (containerContext ContainerContext, err error)

NewContainerContext is to generate a ContainerContext to be show

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL