utils

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const RestrictedNameChars = `[a-zA-Z0-9][a-zA-Z0-9_.-]`

RestrictedNameChars collects the characters allowed to represent a name, normally used to validate container and volume names.

Variables

View Source
var RestrictedNamePattern = regexp.MustCompile(`^` + RestrictedNameChars + `+$`)

RestrictedNamePattern is a regular expression to validate names against the collection of restricted characters.

Functions

func DisableDebug added in v1.10.0

func DisableDebug()

DisableDebug sets the DEBUG env var to false and makes the logger to log at info level.

func EnableDebug added in v1.10.0

func EnableDebug()

EnableDebug sets the DEBUG env var to true and makes the logger to log at debug level.

func GetCallerName added in v0.6.7

func GetCallerName(depth int) string

GetCallerName introspects the call stack and returns the name of the function `depth` levels down in the stack.

func IsDebugEnabled added in v1.10.0

func IsDebugEnabled() bool

IsDebugEnabled checks whether the debug flag is set or not.

func IsProcessAlive added in v1.11.0

func IsProcessAlive(pid int) bool

IsProcessAlive returns true if process with a given pid is running.

func KillProcess added in v1.11.0

func KillProcess(pid int)

KillProcess force-stops a process.

func ReplaceOrAppendEnvValues added in v0.9.0

func ReplaceOrAppendEnvValues(defaults, overrides []string) []string

ReplaceOrAppendEnvValues returns the defaults with the overrides either replaced by env key or appended to the list

func TestDirectory added in v0.6.7

func TestDirectory(templateDir string) (dir string, err error)

TestDirectory creates a new temporary directory and returns its path. The contents of directory at path `templateDir` is copied into the new directory.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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