utils

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirUpLevel

func DirUpLevel(p string, level int) string

DirUpLevel returns dir name of upper `level`

func GetCacheDir

func GetCacheDir() string

GetCacheDir returns goat cache dir. If env GOAT_CACHE_DIR exist, use its value. Otherwise return /tmp/goat

func GetCronFilePath

func GetCronFilePath(user string) string

GetCronFilePath returns the cron file path

func GetWhoAmI

func GetWhoAmI() string

GetWhoAmI returns current user name

func IsDirExist

func IsDirExist(pathname string) bool

IsDirExist returns true if a dir `pathname` exist, returns false otherwise

func IsFileExist

func IsFileExist(filename string) bool

IsFileExist returns true if a file `filename` exist, returns false otherwise

func LsDir

func LsDir(pathname string) ([]string, error)

LsDir list files under pathname and return files that is a dir. return error if pathname is not a dir

func Sha256Sum

func Sha256Sum(input string) string

Sha256Sum use SHA256 hash function to digest the input string and return the hash string

Types

This section is empty.

Jump to

Keyboard shortcuts

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