Documentation ¶
Index ¶
- type Tools
- func (t *Tools) CreateDirIfNotExist(path string) error
- func (t *Tools) RandomString(length int) string
- func (t *Tools) UploadFiles(r *http.Request, uploadDir string, rename ...bool) ([]*UploadedFile, error)
- func (t *Tools) UploadOneFile(r *http.Request, uploadDir string, rename ...bool) (*UploadedFile, error)
- type UploadedFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tools ¶
Tools is the type used to instantiate the toolkit module.
func (*Tools) CreateDirIfNotExist ¶
CreateDirIfNotExist creates a directory, and all necessary parents, if it does not exist.
func (*Tools) RandomString ¶
RandomString returns a random string of the given length.
func (*Tools) UploadFiles ¶
func (t *Tools) UploadFiles(r *http.Request, uploadDir string, rename ...bool) ([]*UploadedFile, error)
UploadFiles uploads files from a multipart form request to the given directory.
func (*Tools) UploadOneFile ¶
func (t *Tools) UploadOneFile(r *http.Request, uploadDir string, rename ...bool) (*UploadedFile, error)
UploadOneFile uploads a single file from a multipart form request to the given directory.
type UploadedFile ¶
UploadedFile is a struct used to save file upload information.
Click to show internal directories.
Click to hide internal directories.