Documentation ¶
Overview ¶
inspiring from https://www.youtube.com/watch?v=1B71SL6Y0kA
Index ¶
- Variables
- func CheckExist(src string) bool
- func CheckImage(src string) error
- func CheckImageExt(fileName string, uploadAllowExt []string) bool
- func CheckImageSize(f multipart.File, uploadMaxSize int) bool
- func CheckNotExist(src string) bool
- func CheckPermission(src string) bool
- func CopyFile(src, dst string) error
- 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 GetExt(file *multipart.FileHeader) (string, error)
- func GetImageFullPath(uploadPath, runtimeRootPath string) string
- func GetImageFullUrl(uploadPath, name string) string
- func GetImageName(name string) string
- func GetLogFilePath(RuntimeRootPath, LogSavePath string) string
- func GetSize(f multipart.File) int
- func IsNotExistMkdir(src string) error
- func Mkdir(src string) error
- func MustOpen(fileName, filePath string) (*os.File, error)
- func Open(name string, flag int, perm os.FileMode) (*os.File, error)
- func OpenLogFile(fileName, filePath string) (*os.File, error)
- func SafeCopyFile(src, dst string) error
- type Dir
- type File
- type FileType
- type SafeCopy
Constants ¶
This section is empty.
Variables ¶
View Source
var FileTypeMap = map[string]FileType{ ".txt": Txt, ".doc": Doc, }
Functions ¶
func CheckExist ¶
func CheckImage ¶
func CheckImageExt ¶
func CheckNotExist ¶
func CheckPermission ¶
func FindFiles2 ¶
path和filepath两个包,filepath文件专用
func GetImageFullPath ¶
func GetImageFullUrl ¶
func GetImageName ¶
func GetLogFilePath ¶
func IsNotExistMkdir ¶
func SafeCopyFile ¶
SafeCopyFile : Error handling by abstraction
Types ¶
type File ¶
type File struct { ID uint64 `gorm:"primary_key" json:"id"` FileName string `gorm:"type:varchar(100);not null" json:"file_name"` OriginalName string `gorm:"type:varchar(100);not null" json:"original_name"` URL string `json:"url"` MD5 string `gorm:"type:varchar(32)" json:"md5"` Mime string `json:"mime"` Size uint64 `json:"size"` }
Click to show internal directories.
Click to hide internal directories.