Documentation ¶
Index ¶
- func SetPickerStrategy(s string) error
- func SetTable(t Table)
- type Table
- func (t Table) AddRoute(service, prefix, target string, weight float64, tags []string) error
- func (t Table) AddRouteWeight(service, prefix string, weight float64, tags []string) error
- func (t Table) Config(addWeight bool) []string
- func (t Table) DelRoute(service, prefix, target string) error
- func (t Table) Lookup(req *http.Request, trace string) *Target
- func (t Table) String() string
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetPickerStrategy ¶
SetPickerStrategy sets the picker function for the proxy.
Types ¶
type Table ¶
type Table map[string]routes
Table contains a set of routes grouped by host. The host routes are sorted from most to least specific by sorting the routes in reverse order by path.
func Parse ¶
Parse loads a routing table from a set of route commands.
The commands are parsed in order and order matters. Deleting a route that has not been created yet yields a different result than the other way around.
Route commands can have the following form:
route add service host/path targetURL - Add a new route for host/path to targetURL route del service - Remove all routes for service route del service host/path - Remove all routes for host/path for this service only route del service host/path targetURL - Remove only this route
func ParseString ¶
ParseString loads a routing table from a string.
func (Table) AddRouteWeight ¶
func (Table) DelRoute ¶
DelRoute removes one or more routes depending on the arguments. If service, prefix and target are provided then only this route is removed. Are only service and prefix provided then all routes for this service and prefix are removed. This removes all active instances of the service from the route. If only the service is provided then all routes for this service are removed. The service will no longer receive traffic.