Documentation ¶
Index ¶
- Constants
- func CheckDirPermission(dir string, perm os.FileMode) error
- func Exist(name string) bool
- func GetEnvironment(key string, alternativeKeys ...string) string
- func GetOrDefault(key, def string, data map[string]string) (result string)
- func GetReplacement(key string, data map[string]string) (result string)
- func IsDirWriteable(dir string) error
- func ParseVersionNum(release string) string
- func PathExists(path string) (bool, error)
Constants ¶
const ( // PrivateFileMode grants owner to read/write a file. PrivateFileMode = 0600 // PrivateDirMode grants owner to make/remove files inside the directory. PrivateDirMode = 0700 )
Variables ¶
This section is empty.
Functions ¶
func CheckDirPermission ¶
CheckDirPermission checks permission on an existing dir. Returns error if dir is empty or exist with a different permission than specified.
func GetEnvironment ¶ added in v0.0.48
GetEnvironment retrieves the value of the environment variable named by the key. If the environment doesn't exist, we will lookup for alternative environment variables until we find an environment. Return empty environment value while no environment variables found.
func GetOrDefault ¶
GetOrDefault returns the value or a default value from a map
func GetReplacement ¶
GetReplacement returns a string which replace via a map
func IsDirWriteable ¶
IsDirWriteable checks if dir is writable by writing and removing a file to dir. It returns nil if dir is writable.
func ParseVersionNum ¶ added in v0.0.40
ParseVersionNum split version from release or tag
func PathExists ¶
PathExists checks if the target path exist or not
Types ¶
This section is empty.