utils

package
v0.3.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultContainerDetachKeys container's default attach keys string
	DefaultContainerDetachKeys = "ctrl-p,ctrl-q"
)

Variables

This section is empty.

Functions

func CreatedToStr

func CreatedToStr(duration int64) string

CreatedToStr converts duration to human readable format

func GetJSONOutput

func GetJSONOutput(v interface{}) (string, error)

GetJSONOutput covnerts interface to json output

func PortsToString

func PortsToString(ports []types.PortMapping) string

PortsToString converts the ports used to a string of the from "port1, port2" and also groups a continuous list of ports into a readable format. The format is IP:HostPort(-Range)->ContainerPort(-Range)/Proto

func PrintJSON

func PrintJSON(data []interface{}) (string, error)

PrintJSON convert data interface to json string

func SizeToStr

func SizeToStr(size int64) string

SizeToStr converts size to human readable format

Types

This section is empty.

Jump to

Keyboard shortcuts

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