Documentation ¶
Index ¶
- func Context(ty http.ResponseWriter) context
- func Dispatch(d Dispatcher) *dispatch
- func First(handler ...http.Handler) first
- func HandlerMethod(fn interface{}) http.Handler
- func HandlerMethod2(fn interface{}) http.Handler
- func Map(data ...interface{}) dispatchMap
- func MustUnWrap(src http.ResponseWriter, target interface{})
- func UnWrap(src http.ResponseWriter, target interface{}) error
- type After
- type Around
- type Before
- type Catch
- type Defer
- type DispatchFunc
- type Dispatcher
- type Guard
- type Handle
- type MatchFragment
- type MatchHeader
- type MatchHost
- type MatchHostRegex
- type MatchQuery
- type MatchScheme
- type Matcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Context ¶
func Context(ty http.ResponseWriter) context
func Dispatch ¶
func Dispatch(d Dispatcher) *dispatch
func HandlerMethod ¶
func HandlerMethod2 ¶
func Map ¶
func Map(data ...interface{}) dispatchMap
data should be pairs of Matcher and http.Handler
func MustUnWrap ¶
func MustUnWrap(src http.ResponseWriter, target interface{})
func MustUnWrap(src interface{}, target interface{}) {
func UnWrap ¶
func UnWrap(src http.ResponseWriter, target interface{}) error
consider a struct that is a http.ResponseWriter via embedding now we want to unwrap this struct to get its properties. since the struct we are looking for might not be the src but instead itself wrapped inside the ResponseWriter property of the given src we will do it recursivly untill be get the struct we look for or did not find it
Types ¶
type Around ¶
does something before and after the request is handled further
func AroundFunc ¶
func AroundFunc(before, after func(http.ResponseWriter, *http.Request)) Around
type Before ¶
does something before the request is handled further
func BeforeFunc ¶
func BeforeFunc(fn func(http.ResponseWriter, *http.Request)) Before
type Catch ¶
type Catch func(p interface{}, w http.ResponseWriter, r *http.Request)
catches an error while executing the request
type DispatchFunc ¶
type Guard ¶
a guard will do something on the responsewriter if further execution is not permitted if it does nothing, the request continues and is handled further down the chain
type Handle ¶
type Handle struct{}
casts the Responsewriter to http.Handler in order to write to itself
type MatchFragment ¶
type MatchFragment string
type MatchHeader ¶
type MatchHeader struct {
Key, Val string
}
type MatchHostRegex ¶
type MatchQuery ¶
type MatchQuery struct {
Key, Val string
}
type MatchScheme ¶
type MatchScheme string