utils

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GVM_DOWNLOAD_DIR    string = "downloads"
	GVM_GOS_DIRNAME     string = "gos"
	GVM_ENV_DIRNAME     string = "environment"
	GVM_PKGSET_NAME     string = "global"
	GVM_PKGSET_DIRNAME  string = "pkgsets"
	GVM_OVERLAY_DIRNAME string = "overlay"
)

Variables

View Source
var ENV_FILE string = `` /* 329-byte string literal not displayed */
View Source
var GOS_REGEXP *regexp.Regexp = getGosRegexp()
View Source
var (
	GVM_ROOT_DIR string = filepath.Join(os.Getenv("HOME"), ".gvm")
)

Functions

func CheckIfAlreadyExist

func CheckIfAlreadyExist(path string) bool

func CheckIfDirExist

func CheckIfDirExist(dirString string) error

func CreateDirStrucutre

func CreateDirStrucutre(dirString string) error

Checks if a directory is present, if it is return no error if not Create the provide directory structure provided in dirString creating all necessery parents

func FatalCheck

func FatalCheck(err error, errorMsg string, v ...interface{})

Check if the error is not nil printing the error and panic after that.

func GetIPv4StringArray

func GetIPv4StringArray(ips []net.IP) []string

Returns a string of IPv4 address from a list of IPs returned after lookup of a hostname for IPs

func JoinFilePartials

func JoinFilePartials(files []string, out string) error

Gets a list of files and joins them into a single file with name out

func MemoryBytesToString

func MemoryBytesToString(byteCount int64) string

Takes byte count in integer format as input and returns a string describing download size denoted by the bytecount

func MkdirIfNotExist

func MkdirIfNotExist(folder string) error

Takes the name of the folder and create directory as according with permissions 755

func PrintInstalledGos

func PrintInstalledGos(gos []string)

func RemoveAll

func RemoveAll(files []string) error

func RemoveFilePartials

func RemoveFilePartials(url string) error

Remove downloaded file partials corresponding to the url

func UntarToDestination

func UntarToDestination(source string, destination string) error

Untar source to destination

Types

This section is empty.

Jump to

Keyboard shortcuts

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