MCPcopy Create free account
hub / github.com/PuerkitoBio/fetchbot / NewMux

Function NewMux

handler.go:60–67  ·  view source on GitHub ↗

NewMux returns an initialized Mux.

()

Source from the content-addressed store, hash-verified

58
59// NewMux returns an initialized Mux.
60func 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.

Callers 2

mainFunction · 0.92
TestMuxFunction · 0.85

Calls 1

HandlerFuncFuncType · 0.85

Tested by 1

TestMuxFunction · 0.68