Documentation ¶
Index ¶
- func Use(h http.Handler, mw ...Middleware) http.Handler
- type Chain
- type HandlerFunc
- type Middleware
- type RouteNode
- type RouterMux
- func (mux *RouterMux) Handle(pattern string, name string, handler http.Handler)
- func (mux *RouterMux) HandleFunc(pattern string, name string, f func(http.ResponseWriter, *http.Request))
- func (mux *RouterMux) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (mux *RouterMux) WithMiddleware(handler http.Handler, middleware ...Middleware) http.Handler
- type StellateRouter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
func NewChain ¶
func NewChain(handler http.Handler, mw ...Middleware) *Chain
func (*Chain) Then ¶
func (c *Chain) Then(mw Middleware) *Chain
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request)
func (HandlerFunc) ServeHTTP ¶
func (f HandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Middleware ¶
func Hook ¶
func Hook(f func(context.Context)) Middleware
Hook middleware function passes the request context to `f` function and then passes the updated context to the next handler using `WithContext`. This allows `f` to be modify the request context as needed. This can be useful for passing data or state between middleware handlers.
func LoggerMiddleware ¶
func LoggerMiddleware() Middleware
func Recovery ¶
func Recovery() Middleware
func (Middleware) ServeHTTP ¶
func (mw Middleware) ServeHTTP(w http.ResponseWriter, r *http.Request)
type RouteNode ¶ added in v0.4.6
type RouteNode struct {
// contains filtered or unexported fields
}
type RouterMux ¶ added in v0.4.6
type RouterMux struct {
// contains filtered or unexported fields
}
func (*RouterMux) Handle ¶ added in v0.4.6
func (*RouterMux) HandleFunc ¶ added in v0.4.6
type StellateRouter ¶ added in v0.4.6
type StellateRouter struct {
// contains filtered or unexported fields
}
func NewRouter ¶ added in v0.4.6
func NewRouter() *StellateRouter
Click to show internal directories.
Click to hide internal directories.