Versions in this module Expand all Collapse all v2 v2.0.0 Jan 25, 2024 Changes in this version + type JSONResponse struct + Data interface{} + Error bool + Message string + type Tools struct + AllowUnknownFields bool + AllowedFileTypes []string + MaxFileSize int + MaxJSONSize int + func (t *Tools) CreateDirIfNotExists(path string) error + func (t *Tools) DownloadStaticFile(writer http.ResponseWriter, request *http.Request, ...) + func (t *Tools) ErrorJSON(writer http.ResponseWriter, err error, status ...int) error + func (t *Tools) PushJSONToRemote(uri string, data any, client ...*http.Client) (*http.Response, int, error) + func (t *Tools) RandomString(n int) string + func (t *Tools) ReadJSON(writer http.ResponseWriter, request *http.Request, data interface{}) error + func (t *Tools) Slugify(s string) (string, error) + func (t *Tools) UploadFiles(r *http.Request, uploadDir string, rename ...bool) ([]*UploadedFile, error) + func (t *Tools) UploadOneFile(request *http.Request, uploadDir string, rename ...bool) (*UploadedFile, error) + func (t *Tools) WriteJSON(writer http.ResponseWriter, status int, data interface{}, ...) error + type UploadedFile struct + FileSize int64 + NewFileName string + OriginalFileName string Other modules containing this package github.com/IgorCastilhos/toolkit