Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddUploader ¶
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 ¶
func SaveMultipartFile(fh *multipart.FileHeader, path string) 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 ¶
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 ¶
type UploaderGenerator func() Uploader
UploaderGenerator is a function return an Uploader.
Click to show internal directories.
Click to hide internal directories.