Documentation ¶
Index ¶
- func CheckAuthorization(r *http.Request, accessLevel int64) bool
- func ClientError(w http.ResponseWriter, status int)
- func NewHelpers(a *config.AppConfig)
- func ReadJSON(w http.ResponseWriter, r *http.Request, data interface{}) error
- func ServerError(w http.ResponseWriter, err error)
- func WriteJSON(w http.ResponseWriter, status int, data interface{}, headers ...http.Header) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckAuthorization ¶
CheckAuthorization checks whether logged in user is authorized to access specific page.
func ClientError ¶
func ClientError(w http.ResponseWriter, status int)
ClientError logs status code of an erorr which occurred on the cliend side, and reeturns http.Error with associated status text.
func ReadJSON ¶
func ReadJSON(w http.ResponseWriter, r *http.Request, data interface{}) error
ReadJSON reads a single JSON value from a request body.
func ServerError ¶
func ServerError(w http.ResponseWriter, err error)
ServerError logs stack trace of an erorr which occurred on the server side, and reeturns http.StatusInternalServerError status code as well as its associated status text.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.