NewMux returns an initialized Mux.
()
| 58 | |
| 59 | // NewMux returns an initialized Mux. |
| 60 | func NewMux() *Mux { |
| 61 | return &Mux{ |
| 62 | // Default handler is a no-op |
| 63 | DefaultHandler: HandlerFunc(func(ctx *Context, res *http.Response, err error) {}), |
| 64 | errm: make(map[error]Handler), |
| 65 | res: make(map[*ResponseMatcher]bool), |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // Handle is the Handler interface implementation for Mux. It dispatches the calls |
| 70 | // to the matching Handler. |