Documentation ¶
Index ¶
- Variables
- func Authorize(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func DisplayAppError(w http.ResponseWriter, handlerError error, message string, code int)
- func GenerateJWT(name, role string) (string, error)
- func TokenFromAuthHeader(r *http.Request) (string, error)
- type AppClaims
- type Level
Constants ¶
This section is empty.
Variables ¶
Package level variables, which are pointer to log.Logger.
View Source
var AppConfig configuration
AppConfig holds the configuration values from config.json file
Functions ¶
func Authorize ¶
func Authorize(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
Authorize Middleware for validating JWT tokens
func DisplayAppError ¶
func DisplayAppError(w http.ResponseWriter, handlerError error, message string, code int)
func GenerateJWT ¶
GenerateJWT generates a new JWT token
Types ¶
Click to show internal directories.
Click to hide internal directories.