Documentation ¶
Index ¶
Constants ¶
View Source
const (
AuthTokenSplit = "Bearer "
)
Variables ¶
This section is empty.
Functions ¶
func CreateHandler ¶
func CreateHandler(mids ...IMiddleware) http.Handler
Types ¶
type HeaderMiddleware ¶
type HeaderMiddleware struct {
// contains filtered or unexported fields
}
func (*HeaderMiddleware) ServeHTTP ¶
func (m *HeaderMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request)
func (*HeaderMiddleware) SetNext ¶
func (m *HeaderMiddleware) SetNext(next IMiddleware)
type IMiddleware ¶
type IMiddleware interface { SetNext(IMiddleware) ServeHTTP(w http.ResponseWriter, req *http.Request) }
func NewHeaderMiddleware ¶
func NewHeaderMiddleware() (IMiddleware, error)
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.