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

Method Handler

handler.go:273–281  ·  view source on GitHub ↗

Handler sets the Handler to be called when this Response Handler is the match for a given response. It registers the Response Handler in its parent Mux.

(h Handler)

Source from the content-addressed store, hash-verified

271// Handler sets the Handler to be called when this Response Handler is the match for
272// a given response. It registers the Response Handler in its parent Mux.
273func (r *ResponseMatcher) Handler(h Handler) *ResponseMatcher {
274 r.mux.mu.Lock()
275 defer r.mux.mu.Unlock()
276 r.h = h
277 if !r.mux.res[r] {
278 r.mux.res[r] = true
279 }
280 return r
281}

Callers 2

TestMuxFunction · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestMuxFunction · 0.64