Documentation
¶
Overview ¶
Package fiber provides utility functions for gofiber v2, jwt-go With additional validation functions, sending JSON response and parsing request bodies, getting JWT claims
Index ¶
- func CheckFieldLength(field, title string, max, min int) (ok bool, message string)
- func GetJSONFieldValues(q interface{}) map[string]string
- func GetJWTClaim(key string) map[string]interface{}
- func GetJWTClaims() jwt.MapClaims
- func GetParamValue(param string, message string) string
- func LogError(err error)
- func ParseBody(in interface{}) error
- func SendBadRequestResponse(message string) error
- func SendJSONMessage(message string, isSuccess bool, httpStatusCode int) error
- func SendSuccessResponse(message string) error
- func ValidateField(field, title string, isMandatory bool, max, min int, format string) (ok bool, message string)
- func ValidateJSONField(q interface{}, tag string, isMandatory bool, max, min int, format string) (bool, string)
- type Context
- type Message
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFieldLength ¶
CheckFieldLength Validation of strings' length and return if valid based on maximum and minimum length specified and error message if invalid
func GetJSONFieldValues ¶
GetJSONFieldValues Returns a map of JSON keys and values of a struct
func GetJWTClaim ¶
GetJWTClaim Wrapper function for getting a JWT claim by key
func GetJWTClaims ¶
GetJWTClaims Get User JWT claims of the current context
func GetParamValue ¶
GetParamValue Gets the parameter value from the copied current context
func ParseBody ¶
func ParseBody(in interface{}) error
ParseBody Parses the request body from the copied current context
func SendBadRequestResponse ¶
SendBadRequestResponse Wrapper function for SendJSONMessage of 400 Bad request
func SendJSONMessage ¶
SendJSONMessage Sends JSON Message with HTTP Status code to current context
func SendSuccessResponse ¶
SendSuccessResponse Wrapper function for SendJSONMessage of 200 Success