Documentation ¶
Index ¶
- func AllowMethods(methods []string) func(http.Handler) http.Handler
- func FileUploadHandler(cfg FileUploadConfig) http.Handler
- func GenerateUUID() string
- func GetI18nPrinter(r *http.Request) *message.Printer
- func LoggingHandler(next http.Handler) http.Handler
- func RecoveryHandler(next http.Handler) http.Handler
- type FileUploadConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowMethods ¶
AllowMethods is http server middleware to limit http request methods
func FileUploadHandler ¶
func FileUploadHandler(cfg FileUploadConfig) http.Handler
FileUploadHandler is http handler to handler file upload
func GetI18nPrinter ¶
GetI18nPrinter return a message.printer according the request header user can override default Accept-Language header by add the language header
func LoggingHandler ¶
LoggingHandler is http server middleware to log http request
Types ¶
type FileUploadConfig ¶
type FileUploadConfig struct { AllowExts []string // allowed file to upload, example .jpg, .png StoragePath string // path to store the uploaded file // ResponseFunc a function to write the response to user ResponseFunc func(w http.ResponseWriter, filenames []string, err error) }
FileUploadConfig config the file upload handler
Click to show internal directories.
Click to hide internal directories.