common

package
v0.0.0-...-b40633b Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoContainer no container error.
	ErrNoContainer = errors.New("no container")
	// ErrNoImage no image error.
	ErrNoImage = errors.New("no image")
	// ErrNoVolume no volume error.
	ErrNoVolume = errors.New("no volume")
	// ErrNoNetwork no network error.
	ErrNoNetwork = errors.New("no network")
	// ErrDockerConnect cannot connect to docker engine error.
	ErrDockerConnect = errors.New("unable to connect to Docker")
	// ErrSmallTerminalWindowSize cannot run docui because of a small terminal window size
	ErrSmallTerminalWindowSize = errors.New("unable to run docui because of a small terminal window size")
)
View Source
var Logger *logger

Logger logger

Functions

func CutNewline

func CutNewline(i string) string

CutNewline cut new line.

func DateNow

func DateNow() string

DateNow return date time.

func GetOSenv

func GetOSenv(env string) string

GetOSenv get os environment.

func IsTerminalWindowSizeThanZero

func IsTerminalWindowSizeThanZero() bool

IsTerminalWindowSizeThanZero check terminal window size

func NewLogger

func NewLogger(logLevel string, logFileName string)

NewLogger create new logger.

func ParseDateToString

func ParseDateToString(unixtime int64) string

ParseDateToString parse date to string.

func ParseLabels

func ParseLabels(labels map[string]string) string

ParseLabels parse image labels.

func ParsePortToString

func ParsePortToString(ports []types.Port) string

ParsePortToString parse port to string.

func ParseRepoTag

func ParseRepoTag(repoTag string) (string, string)

ParseRepoTag parse image repo and tag.

func ParseSizeToString

func ParseSizeToString(size int64) string

ParseSizeToString parse size to string.

func SortKeys

func SortKeys(keys []string) []string

SortKeys sort keys.

func StructToJSON

func StructToJSON(i interface{}) string

StructToJSON convert struct to json.

Types

This section is empty.

Jump to

Keyboard shortcuts

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