utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckError

func CheckError(err error)

func ConvertKVStringsToMap added in v0.2.4

func ConvertKVStringsToMap(values []string) map[string]string

ConvertKVStringsToMap converts ["key=value"] to {"key":"value"} Credit to https://github.com/docker/cli/blob/ebca1413117a3fcb81c89d6be226dcec74e5289f/opts/parse.go#L41

func ConvertKVStringsToMapWithNil added in v0.2.3

func ConvertKVStringsToMapWithNil(values []string) map[string]*string

ConvertKVStringsToMapWithNil converts ["key=value"] to {"key":"value"} but set unset keys to nil - meaning the ones with no "=" in them. We use this in cases where we need to distinguish between

FOO=  and FOO

where the latter case just means FOO was mentioned but not given a value Credit to: https://github.com/docker/cli/blob/ebca1413117a3fcb81c89d6be226dcec74e5289f/opts/parse.go#L60

func ExtractBaseImages

func ExtractBaseImages(input io.Reader) ([]string, error)

func HomeDir

func HomeDir() string

func PrintInfo added in v0.3.0

func PrintInfo(msg string)

PrintInfo prints msg to console

func Prompt added in v0.2.5

func Prompt(hint string) string

func ReadDockerIgnore

func ReadDockerIgnore(contextDir string) ([]string, error)

ReadDockerIgnore reads a .dockerignore file in `contextDir` and returns the list of file patterns to ignore. Note this will trim whitespace from each line as well as use GO's "clean" func to get the shortest/cleanest path for each. Excerpt from https://github.com/docker/docker/blob/master/builder/dockerignore/dockerignore.go

func SetClipboard added in v0.3.0

func SetClipboard(data string) error

SetClipboard copies data to the shear plate of the system

Types

This section is empty.

Jump to

Keyboard shortcuts

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