Documentation ¶
Index ¶
- func CopyDir(src, dst string, overwrite ...bool) error
- func CopyFile(src, dst string, overwrite ...bool) error
- func CreateFileFromByteFn(filename string, overwrite bool, f func() []byte) error
- func CreateFileFromBytes(file string, overwrite bool, content []byte) error
- func CreateFileFromReader(file string, overwrite bool, reader io.Reader) error
- func CreateFileFromString(file string, overwrite bool, content string) error
- func CreateFileFromWriterFunc(file string, overwrite bool, fn func(w io.Writer) error) error
- func DeleteDir(dir string) error
- func DeleteDirFn(dir string, fn func() error) error
- func DeleteFile(file string) error
- func DeleteFileFn(file string, fn func() error) error
- func Extension(filePath string) string
- func Getwd() string
- func IfExists(path string, fn func(path string) error) error
- func IfIsDir(path string, f func() error) error
- func IfIsFile(path string, f func(p string) error) error
- func IfIsRegular(path string, fn func() error) error
- func IfNotExists(path string, fn func(path string) error) error
- func IsDir(path string) bool
- func IsEmptyDir(path string) bool
- func IsExists(path string) bool
- func IsFile(path string) bool
- func IsNotExists(path string) bool
- func IsRegular(path string) bool
- func IsSubDir(parent, child string) bool
- func IsSymlink(path string) bool
- func MatchPattern(patterns []string, name string) bool
- func MkdirIfNotExist(dir string) error
- func WhenFileRead(filename string, callback func([]byte) error) error
- type Chunk
- type SplitFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDir ¶
CopyDir copies a directory from src to dst. returns an error if something goes wrong. if overwrite slice is not empty, the first one will be used to determine if the file should be overwritten.
func CopyFile ¶
CopyFile copies a file from src to dst. returns an error if something goes wrong. if overwrite slice is not empty, the first one will be used to determine if the file should be overwritten.
func CreateFileFromByteFn ¶
CreateFileFromByteFn creates a file from the functionx that returns a byte slice.
func CreateFileFromBytes ¶
CreateFileFromBytes creates a file from the byte slice.
func CreateFileFromReader ¶
CreateFileFromReader creates a file from the reader.
func CreateFileFromString ¶
CreateFileFromString creates a file from the string.
func CreateFileFromWriterFunc ¶
CreateFileFromWriterFunc creates a file from the functionx that returns a writer.
func DeleteDirFn ¶
DeleteDirFn executes the functionx if the directory is deleted.
func DeleteFileFn ¶
DeleteFileFn executes the functionx if the file is deleted.
func IfIsDir ¶
IfIsDir executes the given functionx if the given path is a directory. an error is returned if execution fails.
func IfIsFile ¶
IfIsFile executes the given functionx if the given path is a file. an error is returned if execution fails.
func IfIsRegular ¶
IfIsRegular executes the functionx if the file is a regular file. returns error if execution fails.
func IfNotExists ¶
IfNotExists executes the functionx if the file does not exist. returns error if execution fails.
func IsEmptyDir ¶
func IsNotExists ¶
IsNotExists returns true if the file does not exist.
func MatchPattern ¶
MatchPattern returns true if the filepath matches any of the patterns.
func MkdirIfNotExist ¶
MkdirIfNotExist creates a directory if it does not exist.
Types ¶
type SplitFile ¶
type SplitFile struct {
// contains filtered or unexported fields
}
func NewSplitFile ¶
NewSplitFile creates a new SplitFile.
func NewSplitFileBySize ¶
NewSplitFileBySize create a new SplitFile by size.
func (*SplitFile) SplitFileByChunkNum ¶
SplitFileByChunkNum splits a file into chunks by chunk number.