util

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blkid

func Blkid(label string) (deviceName, deviceType string, err error)

func BlkidType

func BlkidType(deviceType string) (deviceNames []string, err error)

func Contains

func Contains(values []string, value string) bool

func Convert

func Convert(from, to interface{}) error

func ConvertIgnoreOmitEmpty

func ConvertIgnoreOmitEmpty(from, to interface{}) error

func Copy

func Copy(d interface{}) interface{}

func ExistsAndExecutable

func ExistsAndExecutable(path string) bool

func FileCopy

func FileCopy(src, dest string) error

func GenerateDindEngineScript

func GenerateDindEngineScript(name string) error

func GetCurrentContainerID

func GetCurrentContainerID() (string, error)

func GetFsType

func GetFsType(device string) (string, error)

func GetHypervisor

func GetHypervisor() string

GetHypervisor tries to detect if we're running in a VM, and returns a string for its type

func HTTPDownloadToFile

func HTTPDownloadToFile(url, dest string) error

func IsRunningInTty

func IsRunningInTty() bool

func KVPairs2Map

func KVPairs2Map(kvs []string) map[string]string

func Map2KVPairs

func Map2KVPairs(m map[string]string) []string

func MapCopy

func MapCopy(data map[interface{}]interface{}) map[interface{}]interface{}

func Merge

func Merge(left, right map[interface{}]interface{}) map[interface{}]interface{}

func Mount

func Mount(device, target, fsType, options string) error

func RemoveDindEngineScript

func RemoveDindEngineScript(name string) error

func RemoveString

func RemoveString(slice []string, s string) []string

func ResolveDevice

func ResolveDevice(spec string) string

ResolveDevice this isn't reliable - blkid -L LABEL works more often :(

func RunCommandSequence

func RunCommandSequence(commandSequence []osYaml.StringandSlice) error

func RunScript

func RunScript(path string, args ...string) error

func SliceCopy

func SliceCopy(data []interface{}) []interface{}

func ToStrings

func ToStrings(data []interface{}) []string

func TrimSplit

func TrimSplit(str, sep string) []string

func TrimSplitN

func TrimSplitN(str, sep string, count int) []string

func UnescapeKernelParams

func UnescapeKernelParams(s string) string

func Unmount

func Unmount(target string) error

func WriteFileAtomic

func WriteFileAtomic(filename string, data []byte, perm os.FileMode) error

Types

type AnyMap

type AnyMap map[interface{}]interface{}

type Backoff

type Backoff struct {
	StartMillis, MaxIntervalMillis, MaxMillis int
	// contains filtered or unexported fields
}

func (*Backoff) Close

func (b *Backoff) Close() error

func (*Backoff) Start

func (b *Backoff) Start() <-chan bool

type ReturnsErr

type ReturnsErr func() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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