Method
getTree
(statusCode int, method, subdomain string)
Source from the content-addressed store, hash-verified
| 205 | } |
| 206 | |
| 207 | func (h *routerHandler) getTree(statusCode int, method, subdomain string) *trie { |
| 208 | if statusCode > 0 { |
| 209 | for i := range h.errorTrees { |
| 210 | t := h.errorTrees[i] |
| 211 | if t.statusCode == statusCode && t.subdomain == subdomain { |
| 212 | return t |
| 213 | } |
| 214 | } |
| 215 | return nil |
| 216 | } |
| 217 | |
| 218 | for i := range h.trees { |
| 219 | t := h.trees[i] |
| 220 | if t.method == method && t.subdomain == subdomain { |
| 221 | return t |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | return nil |
| 226 | } |
| 227 | |
| 228 | // AddRoute registers a route. See `Router.AddRouteUnsafe`. |
| 229 | func (h *routerHandler) AddRoute(r *Route) error { |
Tested by
no test coverage detected