Documentation
¶
Index ¶
Constants ¶
View Source
const ( AuthTokenHeaderName = "Authorization" AuthTokenSplit = "Bearer " )
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
func CreateHandler(mids ...IMiddleware) http.Handler
Types ¶
type IMiddleware ¶
type IMiddleware interface { SetNext(IMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request) }
func NewJwtMiddleware ¶
func NewJwtMiddleware(config *config.Config) (IMiddleware, error)
func NewRouterMiddleware ¶
func NewRouterMiddleware(routes ...map[myrouter.RouteKey]func(w http.ResponseWriter, r *http.Request, ps common.QueryMap)) IMiddleware
type JwtMiddleware ¶
type JwtMiddleware struct {
// contains filtered or unexported fields
}
func (*JwtMiddleware) ServeHTTP ¶
func (m *JwtMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*JwtMiddleware) SetNext ¶
func (m *JwtMiddleware) SetNext(next IMiddleware)
type RouterMiddleware ¶
type RouterMiddleware struct {
// contains filtered or unexported fields
}
func (*RouterMiddleware) ServeHTTP ¶
func (m *RouterMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*RouterMiddleware) SetNext ¶
func (m *RouterMiddleware) SetNext(next IMiddleware)
Click to show internal directories.
Click to hide internal directories.