mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-16 09:26:21 -05:00
21 lines
461 B
Go
21 lines
461 B
Go
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)
|
|
}
|
|
|
|
// RouterType return the type of Router interface. Can be used to implement common.HasType.
|
|
func RouterType() interface{} {
|
|
return (*Router)(nil)
|
|
}
|