Documentation ¶
Index ¶
- func Chown(f, usr string) (err error)
- func Copy(src, dest string) error
- func CreateParentDir(f string) error
- func DownloadFromUrl(url, localFile string, overWrite bool) (int, error)
- func DownloadViaWget(url, localFile string, overWrite bool) error
- func FQDN() string
- func InStringSlice(s []string, e string) (exist bool)
- func IsFileExist(fpath string) bool
- func IsSameFileContent(f1, f2 string) (bool, error)
- func Md5sum(file string) (string, error)
- func MoreCopy(src, dest string, convertFn CopyConvertFn) error
- func RandStr(l int) string
- func RecursiveFindFiles(root string, pattern string) ([]string, error)
- func Retry(attemptFunc RetriableFunc, maxTries int, sleep time.Duration) (int, error)
- func SafeCreate(f string) (file *os.File, err error)
- func SleepMS(ms int)
- func Split(s, sep string) []string
- func Tree(dir string) (o []byte, err error)
- type CopyConvertFn
- type RetriableError
- type RetriableFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateParentDir ¶
func DownloadFromUrl ¶
return retry times and error
func DownloadViaWget ¶
func FQDN ¶
func FQDN() string
Get Fully Qualified Domain Name returns "unknown" or hostanme in case of error
func IsFileExist ¶
func IsSameFileContent ¶
func MoreCopy ¶
func MoreCopy(src, dest string, convertFn CopyConvertFn) error
func RecursiveFindFiles ¶
recursiveFindFiles find files with pattern in the root with depth.
func Retry ¶
Retry will call attemptFunc up to maxTries until it returns nil, sleeping the specified amount of time between each call. The function can return an error to abort the retrying, or return RetriableError to allow the function to be called again. Returns tried times without running successfully
Types ¶
type CopyConvertFn ¶
type RetriableError ¶
type RetriableError struct {
Failure error
}
RetriableError can be returned by any function called with Retry(), to indicate that it should be retried again after a sleep interval.
func (RetriableError) Error ¶
func (retriable RetriableError) Error() string
type RetriableFunc ¶
type RetriableFunc func() error
Click to show internal directories.
Click to hide internal directories.