Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUploader ¶ added in v1.0.0
func AddUploader(name string, up UploaderGenerator)
AddUploader makes a uploader generator available by the provided theme name. If Add is called twice with the same name or if uploader is nil, it panics.
func SaveMultipartFile ¶ added in v1.0.0
func SaveMultipartFile(fh *multipart.FileHeader, path string) (err error)
SaveMultipartFile used in a local Uploader which help to save file in the local path.
Types ¶
type LocalFileUploader ¶
type LocalFileUploader struct {
BasePath string
}
LocalFileUploader is an Uploader of local file engine.
type UploadFun ¶
type UploadFun func(*multipart.FileHeader, string) (string, error)
UploadFun is a function to process the uploading logic.
type Uploader ¶ added in v1.0.0
Uploader is a file uploader which contains the method Upload.
func GetFileEngine ¶
GetFileEngine return the Uploader of given name.
func GetLocalFileUploader ¶
func GetLocalFileUploader() Uploader
GetLocalFileUploader return the default Uploader.
type UploaderGenerator ¶ added in v1.0.0
type UploaderGenerator func() Uploader
UploaderGenerator is a function return an Uploader.
Click to show internal directories.
Click to hide internal directories.