Mux is a simple multiplexer for the Handler interface, similar to net/http.ServeMux. It is itself a Handler, and dispatches the calls to the matching Handlers. For error Handlers, if there is a Handler registered for the same error value, it will be called. Otherwise, if there is a Handler register
| 49 | // In any case, if no Handler matches, the DefaultHandler is called, and it |
| 50 | // defaults to a no-op. |
| 51 | type Mux struct { |
| 52 | DefaultHandler Handler |
| 53 | |
| 54 | mu sync.RWMutex |
| 55 | errm map[error]Handler |
| 56 | res map[*ResponseMatcher]bool // a set of entries |
| 57 | } |
| 58 | |
| 59 | // NewMux returns an initialized Mux. |
| 60 | func NewMux() *Mux { |
nothing calls this directly
no outgoing calls
no test coverage detected