Versions in this module Expand all Collapse all v1 v1.0.0 Nov 20, 2023 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) CreateDirIfNotExist(path string) error + func (t *Tools) DownloadStaticFile(w http.ResponseWriter, r *http.Request, p, file, displayName string) + func (t *Tools) ErrorJSON(w http.ResponseWriter, err error, status ...int) error + func (t *Tools) PushJSONToRemote(uri string, data interface{}, client ...*http.Client) (*http.Response, int, error) + func (t *Tools) RandomString(n int) string + func (t *Tools) ReadJSON(w http.ResponseWriter, r *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(r *http.Request, uploadDir string, rename ...bool) (*UploadedFile, error) + func (t *Tools) WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error + type UploadedFile struct + FileSize int64 + NewFileName string + OriginalFileName string