MCPcopy
hub / github.com/go-chi/chi / getEdge

Method getEdge

tree.go:331–342  ·  view source on GitHub ↗
(ntyp nodeTyp, label, tail byte, prefix string)

Source from the content-addressed store, hash-verified

329}
330
331func (n *node) getEdge(ntyp nodeTyp, label, tail byte, prefix string) *node {
332 nds := n.children[ntyp]
333 for i := range nds {
334 if nds[i].label == label && nds[i].tail == tail {
335 if ntyp == ntRegexp && nds[i].prefix != prefix {
336 continue
337 }
338 return nds[i]
339 }
340 }
341 return nil
342}
343
344func (n *node) setEndpoint(method methodTyp, handler http.Handler, pattern string) {
345 // Set the handler for the method type on the node

Callers 1

InsertRouteMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected