Documentation ¶
Overview ¶
inspiring from https://www.youtube.com/watch?v=1B71SL6Y0kA
Index ¶
- Constants
- Variables
- func Check(src string) error
- func CheckExist(src string) bool
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func CopyDir(src, dst string) error
- func CopyFile(src, dst string) error
- func CreatFileFromReader(filepath string, reader io.Reader) error
- func CreatFileFromReaderIfNotExists(filepath string, reader io.Reader) error
- func Create(filepath string) (*os.File, error)
- func CreateDir(filepath string) error
- func Exist(filepath string) bool
- func FindFile(path string) (string, error)
- func FindFiles(path string, deep int8, num int) ([]string, error)
- func FindFiles2(path string, deep int8, num int) ([]string, error)
- func GetFileCreateTime(path string) int64
- func GetLogFilePath(RuntimeRootPath, LogSavePath string) string
- func GetMd5Name(name string) string
- func IsNotExistMkdir(src string) error
- func LastFile(dir string) (os.FileInfo, map[string]os.FileInfo, error)
- func Md5(path string) (string, error)
- func Mkdir(src string) error
- func MkdirAll(src string) error
- func MustOpen(fileName, filePath string) (*os.File, error)
- func NotExist(filepath string) bool
- func OpenLogFile(fileName, filePath string) (*os.File, error)
- func RangeDir(dir string, callback func(dir string, entities []os.DirEntry) error) error
- func RangeFile(dir string, callback func(dir string, entry os.DirEntry) error) error
- func SafeCopyFile(src, dst string) error
- func Write(data []byte, filename string) (n int, err error)
- func WriteBuffer(buf *bytes.Buffer, filename string) (n int, err error)
- type Dir
- type DirEntities
- type FileType
- type SafeCopy
Constants ¶
View Source
const DownloadKey = ".downloading"
View Source
const PathSeparator = string(os.PathSeparator)
Variables ¶
View Source
var FileTypeMap = map[string]FileType{ ".txt": Txt, ".doc": Doc, }
Functions ¶
func CheckExist ¶
func CheckNotExist ¶
func CheckPermission ¶
func CreatFileFromReader ¶ added in v1.1.0
func CreatFileFromReaderIfNotExists ¶ added in v1.1.0
func FindFiles2 ¶
path和filepath两个包,filepath文件专用
func GetFileCreateTime ¶
func GetLogFilePath ¶
func GetMd5Name ¶ added in v1.1.0
func IsNotExistMkdir ¶
func SafeCopyFile ¶
SafeCopyFile : Error handling by abstraction
Types ¶
type DirEntities ¶
func (DirEntities) Len ¶
func (e DirEntities) Len() int
func (DirEntities) Less ¶
func (e DirEntities) Less(i, j int) bool
func (DirEntities) Swap ¶
func (e DirEntities) Swap(i, j int)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.