Router consisting of the core routing methods used by chi's Mux, using only the standard net/http.
| 64 | // Router consisting of the core routing methods used by chi's Mux, |
| 65 | // using only the standard net/http. |
| 66 | type Router interface { |
| 67 | http.Handler |
| 68 | Routes |
| 69 | |
| 70 | // Use appends one or more middlewares onto the Router stack. |
| 71 | Use(middlewares ...func(http.Handler) http.Handler) |
| 72 | |
| 73 | // With adds inline middlewares for an endpoint handler. |
| 74 | With(middlewares ...func(http.Handler) http.Handler) Router |
| 75 | |
| 76 | // Group adds a new inline-Router along the current routing |
| 77 | // path, with a fresh middleware stack for the inline-Router. |
| 78 | Group(fn func(r Router)) Router |
| 79 | |
| 80 | // Route mounts a sub-Router along a `pattern` string. |
| 81 | Route(pattern string, fn func(r Router)) Router |
| 82 | |
| 83 | // Mount attaches another http.Handler along ./pattern/* |
| 84 | Mount(pattern string, h http.Handler) |
| 85 | |
| 86 | // Handle and HandleFunc adds routes for `pattern` that matches |
| 87 | // all HTTP methods. |
| 88 | Handle(pattern string, h http.Handler) |
| 89 | HandleFunc(pattern string, h http.HandlerFunc) |
| 90 | |
| 91 | // Method and MethodFunc adds routes for `pattern` that matches |
| 92 | // the `method` HTTP method. |
| 93 | Method(method, pattern string, h http.Handler) |
| 94 | MethodFunc(method, pattern string, h http.HandlerFunc) |
| 95 | |
| 96 | // HTTP-method routing along `pattern` |
| 97 | Connect(pattern string, h http.HandlerFunc) |
| 98 | Delete(pattern string, h http.HandlerFunc) |
| 99 | Get(pattern string, h http.HandlerFunc) |
| 100 | Head(pattern string, h http.HandlerFunc) |
| 101 | Options(pattern string, h http.HandlerFunc) |
| 102 | Patch(pattern string, h http.HandlerFunc) |
| 103 | Post(pattern string, h http.HandlerFunc) |
| 104 | Put(pattern string, h http.HandlerFunc) |
| 105 | Trace(pattern string, h http.HandlerFunc) |
| 106 | |
| 107 | // NotFound defines a handler to respond whenever a route could |
| 108 | // not be found. |
| 109 | NotFound(h http.HandlerFunc) |
| 110 | |
| 111 | // MethodNotAllowed defines a handler to respond whenever a method is |
| 112 | // not allowed. |
| 113 | MethodNotAllowed(h http.HandlerFunc) |
| 114 | } |
| 115 | |
| 116 | // Routes interface adds two methods for router traversal, which is also |
| 117 | // used by the `docgen` subpackage to generation documentation for Routers. |
no outgoing calls
no test coverage detected