Documentation ¶
Index ¶
- func AddFile(ar archiver.Writer, path, commonPath string) error
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func CommonPrefix(sep byte, paths ...string) string
- func ComparisonHash(data []byte, hash string) bool
- func CopyDir(src string, dst string, style string) error
- func CopyFile(src, dst, style string) error
- func CopySingleFile(src, dst, style string) error
- func CreateFile(path string) error
- func CreateFileAndWriteContent(path string, content string) error
- func DataLength(length int) []byte
- func DirSizeB(path string) (int64, error)
- func Exists(path string) bool
- func GetBlockInfo(fileSize int64) (blockSize int, length int)
- func GetCompressionAlgorithm(t string) (string, archiver.Writer, error)
- func GetExt(fileName string) string
- func GetFileOrDirSize(path string) (int64, error)
- func GetHashByContent(data []byte) string
- func GetHashByPath(path string) string
- func GetImage(path string, width, height int) ([]byte, error)
- func GetImageExt(p string) (string, error)
- func GetImageExtByName(p string) (string, error)
- func GetNoDuplicateFileName(fullPath string) string
- func GetSize(f multipart.File) (int, error)
- func GetThumbnailByOwnerPhotos(path string) ([]byte, error)
- func GetThumbnailByWebPhoto(path string, width, height int) ([]byte, error)
- func ImageExtArray() []string
- func IsDir(path string) bool
- func IsFile(path string) bool
- func IsNotExistCreateFile(src string) error
- func IsNotExistMkDir(src string) error
- func MkDir(src string) error
- func MoveFile(sourcePath, destPath string) error
- func MustOpen(fileName, filePath string) (*os.File, error)
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func PrefixLength(byteLength int) []byte
- func RMDir(src string) error
- func ReadFullFile(path string) []byte
- func ReadLine(lineNumber int, path string) string
- func SpliceFiles(dir, path string, length int, startPoint int) error
- func WriteToPath(data []byte, path, name string) error
- type ReadLineFromEnd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPermission ¶
CheckPermission check if the file has permission
func CommonPrefix ¶ added in v0.3.2
func ComparisonHash ¶ added in v0.2.10
Comparison data hash
func CopySingleFile ¶ added in v0.3.3
*
- @description:
- @param {*} src
- @param {*} dst
- @param {string} style
- @return {*}
- @method:
- @router:
func CreateFile ¶
func CreateFileAndWriteContent ¶ added in v0.2.10
func GetBlockInfo ¶ added in v0.2.10
Get info of block
func GetCompressionAlgorithm ¶ added in v0.3.2
func GetFileOrDirSize ¶ added in v0.3.2
func GetHashByContent ¶ added in v0.2.10
get the hash of the data
func GetHashByPath ¶ added in v0.2.10
get the hash of the data
func GetImageExt ¶ added in v0.3.3
* * @description:get a image's ext * @param {string} path "file path" * @return {string} ext "file ext" * @return {error} err "error info"
func GetImageExtByName ¶ added in v0.3.3
func GetNoDuplicateFileName ¶ added in v0.3.0
Check for duplicate file names
func GetThumbnailByOwnerPhotos ¶ added in v0.3.1
func GetThumbnailByWebPhoto ¶ added in v0.3.1
func ImageExtArray ¶ added in v0.3.3
func ImageExtArray() []string
func IsNotExistCreateFile ¶
IsNotExistMkDir create a directory if it does not exist
func IsNotExistMkDir ¶
IsNotExistMkDir create a directory if it does not exist
func PrefixLength ¶ added in v0.2.10
get prefix byte length
func ReadFullFile ¶
func SpliceFiles ¶ added in v0.2.10
最终拼接
func WriteToPath ¶ added in v0.2.10
Types ¶
type ReadLineFromEnd ¶
type ReadLineFromEnd struct {
// contains filtered or unexported fields
}
ReadLineFromEnd --
func NewReadLineFromEnd ¶
func NewReadLineFromEnd(name string) (rd *ReadLineFromEnd, err error)
NewReadLineFromEnd --
func (*ReadLineFromEnd) ReadLine ¶
func (c *ReadLineFromEnd) ReadLine() (line []byte, err error)
ReadLine 结尾包含'\n'
Click to show internal directories.
Click to hide internal directories.