router.go 766 B

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