---------------------------------------------------------------------------- Route factories ---------------------------------------------------------------------------- NewRoute registers an empty route.
()
| 277 | |
| 278 | // NewRoute registers an empty route. |
| 279 | func (r *Router) NewRoute() *Route { |
| 280 | // initialize a route with a copy of the parent router's configuration |
| 281 | route := &Route{routeConf: copyRouteConf(r.routeConf), namedRoutes: r.namedRoutes} |
| 282 | r.routes = append(r.routes, route) |
| 283 | return route |
| 284 | } |
| 285 | |
| 286 | // Name registers a new route with a name. |
| 287 | // See Route.Name(). |