Documentation ¶
Overview ¶
Package util provides some useful utility functions
Index ¶
- func BadRequestResponse(w http.ResponseWriter, err interface{})
- func CreatedResponse(w http.ResponseWriter, resName string, res interface{})
- func ErrorResponse(w http.ResponseWriter, err string)
- func LoadEnv(verify bool) error
- func NotFoundResponse(w http.ResponseWriter, resName string)
- func OKResponse(w http.ResponseWriter, resName string, res interface{})
- func ParseJSONBody(r *http.Request) (map[string]string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequestResponse ¶
func BadRequestResponse(w http.ResponseWriter, err interface{})
func CreatedResponse ¶
func CreatedResponse(w http.ResponseWriter, resName string, res interface{})
func ErrorResponse ¶
func ErrorResponse(w http.ResponseWriter, err string)
func LoadEnv ¶
LoadEnv Loads the environment variables defined in the .env file according to the environment running
func NotFoundResponse ¶
func NotFoundResponse(w http.ResponseWriter, resName string)
func OKResponse ¶
func OKResponse(w http.ResponseWriter, resName string, res interface{})
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.