route

package
v0.0.0-...-b54c588 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RefreshTokenThreshold = 5 * time.Minute
View Source
const SessionTimeout = 30 * time.Minute

Variables

This section is empty.

Functions

func ErrorHandlingMiddleware

func ErrorHandlingMiddleware(next http.HandlerFunc) http.HandlerFunc

ErrorHandlingMiddleware handle panic

func LoggingMiddleware

func LoggingMiddleware(next http.HandlerFunc) http.HandlerFunc

LoggingMiddleware log request

Types

type JWTMiddleware

type JWTMiddleware struct {
	LoginService service.ILoginService `dep:""`
	JWTService   service.IJWTService   `dep:""`
}

func (JWTMiddleware) Constructor

func (lm JWTMiddleware) Constructor() *JWTMiddleware

func (*JWTMiddleware) RefreshTokenMiddleware

func (lm *JWTMiddleware) RefreshTokenMiddleware(next http.HandlerFunc) http.HandlerFunc

func (*JWTMiddleware) ValidateMiddleware

func (lm *JWTMiddleware) ValidateMiddleware(next http.HandlerFunc) http.HandlerFunc

ValidateMiddleware validate JWT

type JWTToken

type JWTToken string

type LoginController

type LoginController struct {
	JWTMiddleware *JWTMiddleware        `dep:""`
	LoginService  service.ILoginService `dep:""`
	JWTService    service.IJWTService   `dep:""`
}

func (LoginController) Constructor

func (c LoginController) Constructor() *LoginController

type MiddlewareFunc

type MiddlewareFunc func(next http.HandlerFunc) http.HandlerFunc

func Compose

func Compose(first MiddlewareFunc, rest ...MiddlewareFunc) MiddlewareFunc

Compose compose a set of middlewares to a single one

type ReturnMessage

type ReturnMessage struct {
	Status  bool   `json:"status"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL