Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorHandlerFunc ¶
type ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ErrorHandlerFunc is the error handler function definition which is used in the Handler interface. All custom handlers must return a func of this type to handle errors
type Handler ¶
type Handler interface { Handle() HandlerFunc Error() ErrorHandlerFunc }
Handler is the primary interface of this package - it defines the two standard functions to implement custom handler types
type HandlerFunc ¶
type HandlerFunc func(w http.ResponseWriter, r *http.Request) error
HandlerFunc defines the standard handler function type, used in the Handler interface. All custom handlers must return a func of this type to handle requests
type HandlerGroup ¶
type HandlerGroup struct {
// contains filtered or unexported fields
}
HandlerGroup holds middleware and is intended to group handlers of the same request type so that the same middleware stack can be applied
func NewHandlerGroup ¶
func NewHandlerGroup(mws []MiddlewareFunc, more ...MiddlewareFunc) *HandlerGroup
NewHandlerGroup returns an instance of HandlerGroup with the middlware functions attached
func (*HandlerGroup) Use ¶
func (hs *HandlerGroup) Use(h Handler, mws ...MiddlewareFunc) http.HandlerFunc
Use returns a http.Handler func, wrapped with middlewares which the request will be handled by the given rf.Handler
type MiddlewareFunc ¶
type MiddlewareFunc func(next HandlerFunc) HandlerFunc
MiddlewareFunc is the type used for all rf specific middleware