xos

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Copy

func Copy(src, dest string) error

Copy copies file, symlink and file metadata from source to target path.

func CopyDir

func CopyDir(src, dest string) error

CopyDir copies directory from source to target path.

func CopyFile

func CopyFile(src, dest string) error

CopyFile copies file from source to target path.

func CopySymlink(src, dest string) error

CopySymlink copies file under symbolic link.

func DirExists added in v0.5.0

func DirExists(name string) (bool, error)

DirExists returns true if given directory exists, false otherwise.

func EnvMapToSlice added in v0.6.0

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

EnvMapToSlice transform a map of key value to a slice of env in the form "key=value". Env vars are sorted by names to get an accurate order while testing.

func EnvMapToString added in v0.9.0

func EnvMapToString(values map[string]string) string

EnvMapToString transform a map of key value to a string in the form "key=value;key1=value1". Env vars are sorted by names to get an accurate order while testing.

func EnvMergeMaps added in v0.6.0

func EnvMergeMaps(values ...map[string]string) map[string]string

EnvMergeMaps merges multiple maps into single one. If the same key exist multiple time, it will be overwritten by the latest occurrence.

func EnvMergeSlices added in v0.6.0

func EnvMergeSlices(values ...[]string) []string

EnvMergeSlices merges multiple slices into single one. If the same key exist multiple time, it will be added in occurrence order.

func EnvSliceToMap added in v0.6.0

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

EnvSliceToMap transform a slice of key=value to a map.

func Exist

func Exist(name string) bool

Exist return true if given file exists, false otherwise.

func GetenvDefault

func GetenvDefault(key, fallback string) string

GetenvDefault retrieves the value of the environment variable named by the key. It returns the value, which will be set to fallback if the variable is empty.

func Remove

func Remove(names ...string) error

Remove removes all given named file or directory.

func RemoveAll

func RemoveAll(paths ...string) error

RemoveAll removes all given path and any children it contains.

func Touch

func Touch(name string) error

Touch creates a new file, truncating it if it already exists.

Types

This section is empty.

Jump to

Keyboard shortcuts

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