blob: 19078af1c06d82a1d4efde97dd902f87b46ed24f [file] [log] [blame]
Matthias Andreas Benkard832a54e2019-01-29 09:27:38 +01001package 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
7import "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.
12type 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}