Matthias Andreas Benkard | 832a54e | 2019-01-29 09:27:38 +0100 | [diff] [blame^] | 1 | package restful |
| 2 | |
| 3 | // Copyright 2013 Ernest Micklei. All rights reserved. |
| 4 | // Use of this source code is governed by a license |
| 5 | // that can be found in the LICENSE file. |
| 6 | |
| 7 | import "net/http" |
| 8 | |
| 9 | // A RouteSelector finds the best matching Route given the input HTTP Request |
| 10 | // RouteSelectors can optionally also implement the PathProcessor interface to also calculate the |
| 11 | // path parameters after the route has been selected. |
| 12 | type RouteSelector interface { |
| 13 | |
| 14 | // SelectRoute finds a Route given the input HTTP Request and a list of WebServices. |
| 15 | // It returns a selected Route and its containing WebService or an error indicating |
| 16 | // a problem. |
| 17 | SelectRoute( |
| 18 | webServices []*WebService, |
| 19 | httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) |
| 20 | } |