fileutil

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigDir  string
	DefaultCacheDir   string
	DefaultEnvdLibDir string
)

Functions

func CWD

func CWD() (string, error)

func CacheFile added in v0.2.0

func CacheFile(filename string) (string, error)

CacheFile returns the location for the specified envd cache file

func ConfigFile added in v0.2.0

func ConfigFile(filename string) (string, error)

ConfigFile returns the location for the specified envd config file

func CreateIfNotExist

func CreateIfNotExist(f string) error

func DirExists

func DirExists(filename string) (bool, error)

DirExists returns true if the directory exists.

func DownloadOrUpdateGitRepo added in v0.2.0

func DownloadOrUpdateGitRepo(url string) (path string, err error)

DownloadOrUpdateGitRepo downloads (if not exist) or update (if exist)

func EnvdHomeDir added in v0.2.0

func EnvdHomeDir(path ...string) string

func FileExists

func FileExists(filename string) (bool, error)

FileExists returns true if the file exists

func FindFileAbsPath added in v0.2.0

func FindFileAbsPath(path, fileName string) (string, error)

FindFileAbsPath returns the absolute path for the given path and file

func GetRandomName added in v0.2.0

func GetRandomName(retry int) string

GetRandomName generates a random name from the list of adjectives and surnames in this package formatted as "adjective_surname". For example 'focused_turing'. If retry is non-zero, a random integer between 0 and 10 will be added to the end of the name, e.g `focused_turing3`

func RemoveAll

func RemoveAll(dirname string) error

func RootDir

func RootDir() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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