NewRouter returns a pointer to a new Router.
(routes []Route, resources map[string]string)
| 115 | |
| 116 | // NewRouter returns a pointer to a new Router. |
| 117 | func NewRouter(routes []Route, resources map[string]string) *Router { |
| 118 | mappedRoutes := map[string]Route{} |
| 119 | for _, route := range routes { |
| 120 | mappedRoutes[route.Name] = route |
| 121 | } |
| 122 | return &Router{ |
| 123 | routes: mappedRoutes, |
| 124 | resources: resources, |
| 125 | } |
| 126 | } |
| 127 | |
| 128 | // CreateRequest returns a request key'd off of the name given. The params are |
| 129 | // merged into the URL and body is set as the request body. |
no outgoing calls
no test coverage detected