Documentation
¶
Index ¶
- Constants
- func ByteCountIEC(b int) string
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func CreateCurrentDateDir(rootPath string, perm os.FileMode) (string, error)
- func CreateDateDir(rootPath string, datetime time.Time, perm os.FileMode) (string, error)
- func CreateDir(perm os.FileMode, args ...string) (string, error)
- func DeleteFile(filename string, args ...string) error
- func FileCreate(content bytes.Buffer, name string)
- func FileExist(path string) bool
- func FileIsExists(filename string) bool
- func FileMonitoringById(ctx context.Context, filePth string, id string, group string, ...)
- func FormatFileSize(fileSize int64) (size string)
- func GetAbsolutePath(filePath string) string
- func GetCurrentPath() string
- func GetExt(fileName string) string
- func GetFileContent(fullFilename string) ([]byte, error)
- func GetFilePath(filePath string) (string, string)
- func GetFileSize(filename string) int64
- func GetFileType(p string) (string, error)
- func GetFilename(filePath string) (string, string, string)
- func GetParentDirectory(directory string) string
- func GetRelativePath(fullpath string) string
- func GetSize(f multipart.File) (int, error)
- func IsDirectory(filename string) bool
- func IsFile(filename string) bool
- func IsHiddenFile(name string) bool
- func IsNotExistMkDir(src string) error
- func MkDir(src string) error
- func MkFileIfNotExist(path string)
- func MkdirIfNotExist(path string)
- func MoveFile(srcFilename, dstPath string, creationDate time.Time) (string, error)
- func MustOpenFile(fileName, filePath string) (*os.File, error)
- func NormalizeEOL(input []byte) []byte
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
- func ParseFileContentType(fileName string) string
- func PathCreate(dir string) error
- func PathExist(addr string) bool
- func SaveFile(data []byte, filename, basePath string, args ...string) (string, error)
- func UploadFileTo(fh *multipart.FileHeader, destDirectory string) (int64, error)
- type FileInfo
- type FileInfoList
- type IFileSize
- type ReplaceHelper
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
This section is empty.
Functions ¶
func ByteCountIEC ¶
func CheckPermission ¶
CheckPermission check if the img has permission
func CreateCurrentDateDir ¶
* 根据当前日期在指定根目录下创建多级目录 *
func CreateDateDir ¶
* 根据指定的日期在指定的目录下创建多级目录 *
func FileCreate ¶
func FileMonitoringById ¶
func GetFilename ¶
* 获取路径里的文件名,不带扩展名的文件名,扩展名 *
func GetParentDirectory ¶
func IsDirectory ¶
func IsHiddenFile ¶
func IsNotExistMkDir ¶
IsNotExistMkDir create a directory if it does not exist
func MkFileIfNotExist ¶
func MkFileIfNotExist(path string)
func MkdirIfNotExist ¶
func MkdirIfNotExist(path string)
func MustOpenFile ¶ added in v0.0.9
MustOpen maximize trying to open the img
func NormalizeEOL ¶
NormalizeEOL will convert Windows (CRLF) and Mac (CR) EOLs to UNIX (LF)
func ParseFileContentType ¶
func PathCreate ¶
func UploadFileTo ¶
func UploadFileTo(fh *multipart.FileHeader, destDirectory string) (int64, error)
Types ¶
type FileInfo ¶
type FileInfo struct { Filename string `form:"filename" json:"filename"` //原始文件名(test.jpg) Data []byte `form:"data" json:"data"` //文件字节切片 Size int64 `form:"size" json:"size"` //大小(单位:字节) Duration int64 `form:"duration" json:"duration"` //时长(单位:秒) Path string `form:"path" json:"path"` //全路径(本地磁盘或第三方文件系统) }
func GetHttpRequestFile ¶
* 获取Http请求里的文件数据 * maxSize: 文件大小限制,0表示不限制 *
type FileInfoList ¶
type FileInfoList []*FileInfo
type ReplaceHelper ¶
func (*ReplaceHelper) DoWrok ¶
func (h *ReplaceHelper) DoWrok() error
Click to show internal directories.
Click to hide internal directories.