Documentation
¶
Index ¶
- func CheckDir(p string, perm ...os.FileMode) bool
- func Exists(p string) bool
- func First(root string, findFn FilterFunc, recursion bool) (string, error)
- func FirstN(root string, limit int, findFn FilterFunc) ([]string, error)
- func FormatSize(b int64) string
- func GetDirSize(p string) int64
- func GetExt(p string) string
- func GetModTime(path string) (int64, error)
- func IsDir(p string) bool
- func IsFile(p string) bool
- func Md5(file string) (fileMd5 string, err error)
- func Md5FromByte(data []byte) (fileMd5 string, err error)
- func Md5FromReader(reader io.Reader) (fileMd5 string, err error)
- func Mime(file string) string
- func MimeFromByte(data []byte) string
- func MimeFromReader(reader io.Reader) string
- func Move(src string, dst string) error
- func ReadIni(path string, v interface{}) error
- func ReadJSON(path string, v interface{}) error
- func ReadLines(file string) (lines []string, err error)
- func ReadLinesWithFilter(file string, handle func(line string) (matched bool, broken bool)) (lines []string, err error)
- func ReadString(path string) (str string, err error)
- func ReadYaml(path string, v interface{}) error
- func RemoveWithGlob(path string) (err error)
- func SafePath(path string) string
- func SizeStringToNumber(sizeStr string, unit ...string) (size int64, err error)
- func ToLinux(path string) string
- func Unzip(zipFile string, destDir string, filterFn FilterFunc) error
- func Zip(srcFile string, destZip string, filterFn FilterFunc) error
- type ByModTimeAsc
- type ByModTimeDesc
- type FilterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
func GetDirSize ¶
func GetModTime ¶
func Md5FromByte ¶
func MimeFromByte ¶
func MimeFromReader ¶
func ReadLinesWithFilter ¶
func ReadString ¶
func RemoveWithGlob ¶
func SizeStringToNumber ¶
Types ¶
type ByModTimeAsc ¶
func SortByModTimeAsc ¶
func SortByModTimeAsc(fis []os.FileInfo) (sortedFiles ByModTimeAsc)
func (ByModTimeAsc) Len ¶
func (fis ByModTimeAsc) Len() int
func (ByModTimeAsc) Less ¶
func (fis ByModTimeAsc) Less(i, j int) bool
func (ByModTimeAsc) Swap ¶
func (fis ByModTimeAsc) Swap(i, j int)
type ByModTimeDesc ¶
func SortByModTimeDesc ¶
func SortByModTimeDesc(fis []os.FileInfo) (sortedFiles ByModTimeDesc)
func (ByModTimeDesc) Len ¶
func (fis ByModTimeDesc) Len() int
func (ByModTimeDesc) Less ¶
func (fis ByModTimeDesc) Less(i, j int) bool
func (ByModTimeDesc) Swap ¶
func (fis ByModTimeDesc) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.