Versions in this module Expand all Collapse all v1 v1.0.0 Feb 11, 2017 Changes in this version + var ErrFileExists = errors.New("file already exists") + var ErrFileTooLarge = errors.New("file too large") + var ErrMissingFile = errors.New("no such file") + func SetConfig(cfg *UploadConfig) + func SetStore(store Storer) + type FileInfo struct + Ext string + Name string + Path string + Size int64 + func Upload(r *http.Request, key string, fnh FileNameHandle, fsh FileSizeHandle) (*FileInfo, error) + func UploadMulti(r *http.Request, key string, fnh FileNameHandle, fsh FileSizeHandle) ([]*FileInfo, error) + func UploadReader(r io.Reader, fnh FileNameHandle, fsh FileSizeHandle) (*FileInfo, error) + type FileNameHandle func(base, filename string) string + type FileSizeHandle func(size int64) bool + type FileStoreConfig struct + Rewrite bool + type Storer interface + Store func(filename string, r io.Reader, size int64) error + func NewFileStore(cfgs ...*FileStoreConfig) Storer + type UploadConfig struct + BasePath string + MaxMemory int64 + SizeLimit int64 + type Uploader interface + Upload func(r *http.Request, key string, fnh FileNameHandle, fsh FileSizeHandle) (*FileInfo, error) + UploadMulti func(r *http.Request, key string, fnh FileNameHandle, fsh FileSizeHandle) ([]*FileInfo, error) + UploadReader func(r io.Reader, fnh FileNameHandle, fsh FileSizeHandle) (*FileInfo, error) + func NewUploader(store Storer, cfgs ...*UploadConfig) Uploader Incompatible versions in this module v2.1.0+incompatible Jun 27, 2019 v2.0.0+incompatible Jul 18, 2017