Documentation ¶
Index ¶
- type Middleware
- func (m *Middleware) DefaultTokenFailedAction(w http.ResponseWriter, r *http.Request)
- func (m *Middleware) ServeMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
- func (m *Middleware) SetTokenFailedAction(action func(w http.ResponseWriter, r *http.Request))
- func (m *Middleware) Warnings() []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware struct { //Enabled if this middleware is enabled. Enabled bool //ForwardedForHeader request header name which stores real ip. //If set to empty string,this feature will be disabeld. ForwardedForHeader string //ForwardedHostHeader request header name which stores real host. //If set to empty string,this feature will be disabeld. ForwardedHostHeader string //ForwardedProtoHeader request header name which stores real proto. //If set to empty string,this feature will be disabeld. ForwardedProtoHeader string //ForwardedTokenHeader request header name which stores token. //If set to empty string,this feature will be disabeld. ForwardedTokenHeader string //ForwardedTokenValue value which request header must equal. ForwardedTokenValue string //FailErrorCode error code raised when forwarded token verification fail. FailStatusCode int //Debug debug mode.Echo client ip in header "X-Remote-Addr". Debug bool // contains filtered or unexported fields }
Middleware main middleware struct.
func (*Middleware) DefaultTokenFailedAction ¶
func (m *Middleware) DefaultTokenFailedAction(w http.ResponseWriter, r *http.Request)
DefaultTokenFailedAction return default token failed action
func (*Middleware) ServeMiddleware ¶
func (m *Middleware) ServeMiddleware(w http.ResponseWriter, r *http.Request, next http.HandlerFunc)
ServeMiddleware return middleware.
func (*Middleware) SetTokenFailedAction ¶
func (m *Middleware) SetTokenFailedAction(action func(w http.ResponseWriter, r *http.Request))
SetTokenFailedAction set action which will execute when token verification fail
func (*Middleware) Warnings ¶
func (m *Middleware) Warnings() []string
Warnings show warnings if forwarded middleware settings is not safe.
Click to show internal directories.
Click to hide internal directories.