Documentation ¶
Index ¶
- Variables
- func ByteSize(bytes uint64) string
- func Chmod(path string, mod os.FileMode)
- func CreateFile(path string, size int64)
- func CreateFolder(path string)
- func Elapsed(s string, start time.Time)
- func Exit()
- func Finish()
- func FromByteSize(s string) string
- func GenTempFileName(parts ...string) string
- func GetDstPath(srcPrefix, srcPath, dstPrefix string) string
- func GetFileCRC32C(path string) uint32
- func GetFileMD5(path string) []byte
- func GetFileModificationTime(path string) time.Time
- func GetFileSize(path string) int64
- func GetRelativePath(dir, path string) string
- func GetTempFile(path string) string
- func GetWorkDir() string
- func IsPathDirectory(path string) bool
- func IsPathExist(path string) bool
- func IsPathFile(path string) bool
- func IsSubPath(subPath, path string) bool
- func IsTempFile(path string) bool
- func JoinPath(dir string, parts ...string) string
- func ParseFile(input string) (string, string)
- func ParseURL(input string) (string, string, string)
- func Recovery()
- func SetFileModificationTime(path string, mt time.Time)
- func SetPrefixAsDirectory(prefix string) string
Constants ¶
This section is empty.
Variables ¶
var AppMode bool
Functions ¶
func CreateFile ¶
CreateFile creates an empty file with given length (if size > 0)
func FromByteSize ¶
FromByteSize converts size string in bytes into uinit, e.g., 1024 into 1K
func GenTempFileName ¶
GenTempFileName generate /tmp/%x files where %x is md5 value of all parts concate together
func GetDstPath ¶
GetDstPath gets the destination path
func GetFileModificationTime ¶
GetFileModificationTime gets mtime of a file
func GetRelativePath ¶
GetRelativePath gets the relative path given path and directory
func GetWorkDir ¶
func GetWorkDir() string
GetWorkDir returns the directory where the executable file put
func IsPathDirectory ¶
IsPathDirectory determines if a path is a directory
func IsSubPath ¶
IsSubPath checks if a path is under another one in directory manner case 1: gs://abc/def -> gs://abc/def : true case 2: gs://abc/def -> gs://abc/de : false case 3: gs://abc/def -> gs://abc/def/ : false case 4: gs://abc/def/-> gs://abc/def/ : true case 5: gs://abc/def/ghi -> gs://abc/def : true case 6: gs://abc/def/ghi -> gs://abc/de : false case 7: gs://abc/def/ghi -> gs://abc/def/ : true
func SetFileModificationTime ¶
SetFileModificationTime sets mtime to a file
func SetPrefixAsDirectory ¶
SetPrefixAsDirectory sets the prefix as directory
Types ¶
This section is empty.