Documentation
¶
Index ¶
- Variables
- func CopyFileIntoResponse(dir string, filename string, w http.ResponseWriter)
- func CreateSlug(title string) string
- func DeleteCookie(w http.ResponseWriter, cookie *http.Cookie)
- func FileUploadHandler(field string, maxSizeInMB int64, mimeTypes []string, directory string) http.HandlerFunc
- func FilterStruct(input any, exposures map[string]bool) map[string]any
- func GetPageCount(totalEntities int64, pageLimit int64) int32
- func ParseIntURLParam(name string, vars map[string]string) (int, error)
- func ParseJSONFromRequest(r *http.Request, payload any) error
- func ParseRequestPayload[T any](r *http.Request, payload *T) error
- func ParseStringURLParam(name string, vars map[string]string) (string, error)
- func ParseURLQuery(mapping map[string]any, values url.Values) error
- func PathExists(path string) (bool, error)
- func Ptr[T any](v T) *T
- func RoundToNDecimals(val float64, n int) float64
- func RoundToNDecimals32(val float32, n int) float32
- func WriteErrorInResponse(w http.ResponseWriter, status int, err error) error
- func WriteJSONInResponse(w http.ResponseWriter, status int, payload any, headers *map[string]string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Validator = validator.New()
Functions ¶
func CopyFileIntoResponse ¶
func CopyFileIntoResponse(dir string, filename string, w http.ResponseWriter)
func CreateSlug ¶
func DeleteCookie ¶
func DeleteCookie(w http.ResponseWriter, cookie *http.Cookie)
func FileUploadHandler ¶
func GetPageCount ¶
func ParseStringURLParam ¶
func PathExists ¶
func RoundToNDecimals ¶
func RoundToNDecimals32 ¶
func WriteErrorInResponse ¶
func WriteErrorInResponse(w http.ResponseWriter, status int, err error) error
func WriteJSONInResponse ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.