1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-06-17 13:05:24 +00:00
v2fly/features/routing/router.go

21 lines
461 B
Go
Raw Normal View History

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 21:57:56 +00:00
2018-10-13 13:15:49 +00:00
// RouterType return the type of Router interface. Can be used to implement common.HasType.
2018-10-12 21:57:56 +00:00
func RouterType() interface{} {
return (*Router)(nil)
}