Documentation ¶
Index ¶
- func Backup(vdir string, verbose int) error
- func BackupFile(vdir, fid, bdir string) error
- func BackupTDir(bdir string) (string, error)
- func Copy(src, dst string) (int64, error)
- func EcmHome() string
- func FileExist(path string) bool
- func Files(vdir string) ([]string, error)
- func GetPasswordHash(password string) (string, error)
- func InList(a string, list []string) bool
- func MacAddress() uint64
- func RandomString(strSize int, randType string) string
- func ReadInput(msg string) (string, error)
- func ReadPassword() (string, error)
- func SizeFormat(val interface{}) string
- type StringList
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackupFile ¶
BackupFile perform backup copy of given file in vault dir
func BackupTDir ¶
helper function to create timestamp subdir in backdur
func Copy ¶
Copy performs backup copy of source to destination based on https://github.com/mactsouk/opensource.com/blob/master/cp1.go
func GetPasswordHash ¶
GetPasswordHash generates password hash
func MacAddress ¶
func MacAddress() uint64
MacAddress returns mac address of the host https://gist.github.com/tsilvers/085c5f39430ced605d970094edf167ba
func RandomString ¶
RandomString generates random string
func ReadInput ¶
ReadInput read user input from stdout https://gosamples.dev/read-user-input/
func ReadPassword ¶
ReadPassword reads input password from stdout
func SizeFormat ¶
func SizeFormat(val interface{}) string
SizeFormat helper function to convert size into human readable form
Types ¶
type StringList ¶
type StringList []string
StringList implement sort for []string type
func (StringList) Less ¶
func (s StringList) Less(i, j int) bool
Less implements less function for []int type
func (StringList) Swap ¶
func (s StringList) Swap(i, j int)
Swap implements swap function for []int type