2018-10-11 14:43:37 -04:00
|
|
|
package routing
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"v2ray.com/core/features"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Router is a feature to choose an outbound tag for the given request.
|
|
|
|
type Router interface {
|
|
|
|
features.Feature
|
|
|
|
|
|
|
|
// PickRoute returns a tag of an OutboundHandler based on the given context.
|
|
|
|
PickRoute(ctx context.Context) (string, error)
|
|
|
|
}
|
2018-10-12 17:57:56 -04:00
|
|
|
|
2018-10-13 09:15:49 -04:00
|
|
|
// RouterType return the type of Router interface. Can be used to implement common.HasType.
|
2018-10-12 17:57:56 -04:00
|
|
|
func RouterType() interface{} {
|
|
|
|
return (*Router)(nil)
|
|
|
|
}
|