Documentation ¶
Index ¶
- Constants
- func AuthenticationHandler(next http.Handler) http.Handler
- func GenerateJwt(userID int) string
- func GetKey() string
- func GetName() string
- func IsDebug() bool
- func Logger(next http.Handler) http.Handler
- func ParseBody(body io.ReadCloser, result interface{}) error
- func ResetTestMigrations(source string) error
- func Respond(w http.ResponseWriter, r *http.Request, status int, data interface{}) error
- func ShiftPath(p string) (head, tail string)
- func VerifyJwt(userID int, token string) map[string]interface{}
- type Route
Constants ¶
View Source
const ( // ContextOriginalPath holds the original request URL ContextOriginalPath key = iota // ContextRequestStart holds the request start time ContextRequestStart // ContextDatabase holds a reference to a data.DB database connection and services ContextDatabase // ContextAuth holds the authenticated user account id and user id ContextAuth // ContextRequestDump holds the request data ContextRequestDump )
Variables ¶
This section is empty.
Functions ¶
func AuthenticationHandler ¶
AuthenticationHandler middleware to check for the jwt header for every request
func GenerateJwt ¶
GenerateJwt generates a new jwt token based on the user_id
func ParseBody ¶
func ParseBody(body io.ReadCloser, result interface{}) error
ParseBody parses the request body into a struct
func ResetTestMigrations ¶
ResetTestMigrations reverts and runs every migration on /migrations folder
Types ¶
Click to show internal directories.
Click to hide internal directories.