Documentation ¶
Index ¶
- func CopyFileContents(src, dst string) (err error)
- func FileExists(path string) bool
- func InitLog(logLevel string, logPath string) error
- func IsAdmin() bool
- func ReadJson(file string, res interface{}) (interface{}, error)
- func Retry(attempts int, sleep time.Duration, toExec func() error, onError func(e error)) error
- func SliceDiff(x, y []string) []string
- func WriteJson(file string, obj interface{}) error
- type Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFileContents ¶
CopyFileContents copies contents of the given src file to the dst file
func FileExists ¶ added in v0.8.1
FileExists returns true if specified file exists
func Retry ¶
Retry retries a given toExec function calling onError on failed attempts onError shouldn be a lightweight function and shouldn't be blocking
Types ¶
type Duration ¶
Duration is used strictly for JSON requests/responses due to duration marshalling issues
func (Duration) MarshalJSON ¶
func (*Duration) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.