utils

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserOnlyMode  os.FileMode = 0700
	UserGroupMode os.FileMode = 0770
	WorldMode     os.FileMode = 0777
)

Variables

This section is empty.

Functions

func Contains

func Contains(s []string, e string) bool

func CreateDirIfNotExist added in v0.0.6

func CreateDirIfNotExist(path string, perm os.FileMode) error

CreateDirIfNotExist returns whether the given directory exists Attempts to create the full path if it does not exist

func CreateFileIfNotExist added in v0.0.6

func CreateFileIfNotExist(filePath string, perm os.FileMode) error

CreateFileIfNotExist returns whether the given file exists Attempts to create the full path and file if it does not exist

func IsDirectory added in v0.0.6

func IsDirectory(path string) (bool, error)

func IsYaml added in v0.0.7

func IsYaml(s []byte) (bool, error)

IsYaml verifies that a byte string is value YAML syntax On failure, returns an error with the reason

func Retry added in v0.0.4

func Retry(attempts int, sleep time.Duration, fn func() error) error

Retry will make a given number of attempts to run the provided function sleeping between each attempt

Types

This section is empty.

Jump to

Keyboard shortcuts

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