router.go 461 B

1234567891011121314151617181920
  1. package routing
  2. import (
  3. "context"
  4. "v2ray.com/core/features"
  5. )
  6. // Router is a feature to choose an outbound tag for the given request.
  7. type Router interface {
  8. features.Feature
  9. // PickRoute returns a tag of an OutboundHandler based on the given context.
  10. PickRoute(ctx context.Context) (string, error)
  11. }
  12. // RouterType return the type of Router interface. Can be used to implement common.HasType.
  13. func RouterType() interface{} {
  14. return (*Router)(nil)
  15. }