Documentation
¶
Index ¶
- func CreateDir(dir string) (string, error)
- func CreateDirFromFilename(destination string, s string) (string, error)
- func CreateFileWithDir(destination string) (string, error)
- func EncodeFileToBase64(filename string) (string, error)
- func FileExists(path string) bool
- func Float64ToTime(f float64) time.Time
- func FormatInt(n int) string
- func FormatInt64(n int64) string
- func GetHash(data []byte) string
- func GetMimeType(s string) (string, error)
- func HasBOM(fileName string) bool
- func LeftTrucate(s string, max int) string
- func MoveFile(sourcePath, destPath string) error
- func RandSleep()
- func RemoveFolder(path string) error
- func SafeFileName(s string) string
- func ShuffleStr(slice []string)
- func SliceHasInt(slice []int, item int) bool
- func SliceHasStr(slice []string, item string) bool
- func SliceHasUInt16(slice []uint16, item uint16) bool
- func TempFileName(base_path, prefix, suffix string) string
- func UniqueIntSlice(slice []int) []int
- func Unzip(src, dest string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDir ¶
CreateDir creates a directory if it does not exist, returning the final normalized directory as a result.
func CreateDirFromFilename ¶
func CreateFileWithDir ¶
CreateFileWithDir creates a file, relative to a directory, returning the final normalized path as a result.
func EncodeFileToBase64 ¶
func Float64ToTime ¶
Float64ToTime takes a float64 as number of seconds since unix epoch and returns time.Time
example field where this is used (expires field):
https://chromedevtools.github.io/devtools-protocol/tot/Network/#type-Cookie
func FormatInt64 ¶
func GetMimeType ¶
func LeftTrucate ¶
LeftTrucate a string if its more than max
func RemoveFolder ¶
func SafeFileName ¶
SafeFileName takes a string and returns a string safe to use as a file name.
func SliceHasInt ¶
SliceHasInt checks if a slice has an int
func SliceHasStr ¶
SliceHasStr checks if a slice has a string
func SliceHasUInt16 ¶
SliceHasInt checks if a slice has an int
func TempFileName ¶
func UniqueIntSlice ¶
UniqueIntSlice returns a slice of unique ints
Types ¶
This section is empty.