util

package
v2.0.0-beta.1+incompat... Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayDedup

func ArrayDedup(a []string) []string

func Contains

func Contains(slice []string, search string) bool

func CopyDir

func CopyDir(src string, dst string) (err error)

CopyDir recursively copies a directory tree, attempting to preserve permissions. Source directory must exist, destination directory must *not* exist. Symlinks are ignored and skipped.

func CopyFile

func CopyFile(src, dst string) (err error)

CopyFile copies the contents of the file named src to the file named by dst. The file will be created if it does not already exist. If the destination file exists, all it's contents will be replaced by the contents of the source file. The file mode will be copied from the source and the copied data is synced/flushed to stable storage.

func CreateReducedYAMLFile

func CreateReducedYAMLFile(filename, key string, required bool) ([]byte, error)

func FuzzySemVerCompare

func FuzzySemVerCompare(s1, s2 string) bool

Loosely fits the best-effot semver sort implemented by `sort -V`

func LineDiff

func LineDiff(expected, found string) string

LineDiff takes two strings and returns a description of the first differing line.

func MapSliceRegexMatch

func MapSliceRegexMatch(mapSlice yaml.MapSlice, key string) (interface{}, error)

func MultiErrorFormat

func MultiErrorFormat(errs []error) string

MultiErrorFormat takes a slice of errors and returns them as a combined string

func PromptForInput

func PromptForInput(defaultValue string, label string) (string, error)

func PromptForPassword

func PromptForPassword() (string, error)

func PromptForSelection

func PromptForSelection(choices []string, label string) (string, error)

func PromptForUsername

func PromptForUsername() (string, error)

func SemverBump

func SemverBump(version string, semVerType string) (string, error)

func Untar

func Untar(dst string, r io.Reader) error

Untar takes a destination path and a reader; a tar reader loops over the tarfile creating the file structure at 'dst' along the way, and writing any files

Types

type CustomFormatter

type CustomFormatter struct {
	IsTerminal bool
}

func (*CustomFormatter) Format

func (f *CustomFormatter) Format(entry *logrus.Entry) ([]byte, error)

type HelmChart

type HelmChart struct {
	Name string
}

func ReadChartDirectory

func ReadChartDirectory(chartDir string) (*HelmChart, error)

Jump to

Keyboard shortcuts

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