import "v2ray.com/core/app/router/command"
command.go command.pb.go command_grpc.pb.go config.go errors.generated.go
var File_app_router_command_command_proto protoreflect.FileDescriptor
func AsProtobufMessage(fieldSelectors []string) func(routing.Route) *RoutingContext
AsProtobufMessage takes selectors of fields and returns a function to convert routing.Route to protobuf RoutingContext.
func AsRoutingContext(r *RoutingContext) routing.Context
AsRoutingContext converts a protobuf RoutingContext into an implementation of routing.Context.
func AsRoutingRoute(r *RoutingContext) routing.Route
AsRoutingRoute converts a protobuf RoutingContext into an implementation of routing.Route.
func RegisterRoutingServiceServer(s *grpc.Server, srv RoutingServiceServer)
type Config struct {
// contains filtered or unexported fields
}
Deprecated: Use Config.ProtoReflect.Descriptor instead.
func (x *Config) ProtoReflect() protoreflect.Message
type RoutingContext struct { InboundTag string `protobuf:"bytes,1,opt,name=InboundTag,proto3" json:"InboundTag,omitempty"` Network net.Network `protobuf:"varint,2,opt,name=Network,proto3,enum=v2ray.core.common.net.Network" json:"Network,omitempty"` SourceIPs [][]byte `protobuf:"bytes,3,rep,name=SourceIPs,proto3" json:"SourceIPs,omitempty"` TargetIPs [][]byte `protobuf:"bytes,4,rep,name=TargetIPs,proto3" json:"TargetIPs,omitempty"` SourcePort uint32 `protobuf:"varint,5,opt,name=SourcePort,proto3" json:"SourcePort,omitempty"` TargetPort uint32 `protobuf:"varint,6,opt,name=TargetPort,proto3" json:"TargetPort,omitempty"` TargetDomain string `protobuf:"bytes,7,opt,name=TargetDomain,proto3" json:"TargetDomain,omitempty"` Protocol string `protobuf:"bytes,8,opt,name=Protocol,proto3" json:"Protocol,omitempty"` User string `protobuf:"bytes,9,opt,name=User,proto3" json:"User,omitempty"` Attributes map[string]string `protobuf:"bytes,10,rep,name=Attributes,proto3" json:"Attributes,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` OutboundGroupTags []string `protobuf:"bytes,11,rep,name=OutboundGroupTags,proto3" json:"OutboundGroupTags,omitempty"` OutboundTag string `protobuf:"bytes,12,opt,name=OutboundTag,proto3" json:"OutboundTag,omitempty"` // contains filtered or unexported fields }
RoutingContext is the context with information relative to routing process. It conforms to the structure of v2ray.core.features.routing.Context and v2ray.core.features.routing.Route.
func (*RoutingContext) Descriptor() ([]byte, []int)
Deprecated: Use RoutingContext.ProtoReflect.Descriptor instead.
func (x *RoutingContext) GetAttributes() map[string]string
func (x *RoutingContext) GetInboundTag() string
func (x *RoutingContext) GetNetwork() net.Network
func (x *RoutingContext) GetOutboundGroupTags() []string
func (x *RoutingContext) GetOutboundTag() string
func (x *RoutingContext) GetProtocol() string
func (x *RoutingContext) GetSourceIPs() [][]byte
func (x *RoutingContext) GetSourcePort() uint32
func (x *RoutingContext) GetTargetDomain() string
func (x *RoutingContext) GetTargetIPs() [][]byte
func (x *RoutingContext) GetTargetPort() uint32
func (x *RoutingContext) GetUser() string
func (*RoutingContext) ProtoMessage()
func (x *RoutingContext) ProtoReflect() protoreflect.Message
func (x *RoutingContext) Reset()
func (x *RoutingContext) String() string
type RoutingServiceClient interface { SubscribeRoutingStats(ctx context.Context, in *SubscribeRoutingStatsRequest, opts ...grpc.CallOption) (RoutingService_SubscribeRoutingStatsClient, error) TestRoute(ctx context.Context, in *TestRouteRequest, opts ...grpc.CallOption) (*RoutingContext, error) }
RoutingServiceClient is the client API for RoutingService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient
type RoutingServiceServer interface { SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error) // contains filtered or unexported methods }
RoutingServiceServer is the server API for RoutingService service. All implementations must embed UnimplementedRoutingServiceServer for forward compatibility
NewRoutingServer creates a statistics service with statistics manager.
type RoutingService_SubscribeRoutingStatsClient interface { Recv() (*RoutingContext, error) grpc.ClientStream }
type RoutingService_SubscribeRoutingStatsServer interface { Send(*RoutingContext) error grpc.ServerStream }
type SubscribeRoutingStatsRequest struct { FieldSelectors []string `protobuf:"bytes,1,rep,name=FieldSelectors,proto3" json:"FieldSelectors,omitempty"` // contains filtered or unexported fields }
SubscribeRoutingStatsRequest subscribes to routing statistics channel if opened by v2ray-core. * FieldSelectors selects a subset of fields in routing statistics to return. Valid selectors:
- inbound: Selects connection's inbound tag. - network: Selects connection's network. - ip: Equivalent as "ip_source" and "ip_target", selects both source and target IP. - port: Equivalent as "port_source" and "port_target", selects both source and target port. - domain: Selects target domain. - protocol: Select connection's protocol. - user: Select connection's inbound user email. - attributes: Select connection's additional attributes. - outbound: Equivalent as "outbound" and "outbound_group", select both outbound tag and outbound group tags.
* If FieldSelectors is left empty, all fields will be returned.
func (*SubscribeRoutingStatsRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscribeRoutingStatsRequest.ProtoReflect.Descriptor instead.
func (x *SubscribeRoutingStatsRequest) GetFieldSelectors() []string
func (*SubscribeRoutingStatsRequest) ProtoMessage()
func (x *SubscribeRoutingStatsRequest) ProtoReflect() protoreflect.Message
func (x *SubscribeRoutingStatsRequest) Reset()
func (x *SubscribeRoutingStatsRequest) String() string
type TestRouteRequest struct { RoutingContext *RoutingContext `protobuf:"bytes,1,opt,name=RoutingContext,proto3" json:"RoutingContext,omitempty"` FieldSelectors []string `protobuf:"bytes,2,rep,name=FieldSelectors,proto3" json:"FieldSelectors,omitempty"` PublishResult bool `protobuf:"varint,3,opt,name=PublishResult,proto3" json:"PublishResult,omitempty"` // contains filtered or unexported fields }
TestRouteRequest manually tests a routing result according to the routing context message. * RoutingContext is the routing message without outbound information. * FieldSelectors selects the fields to return in the routing result. All fields are returned if left empty. * PublishResult broadcasts the routing result to routing statistics channel if set true.
func (*TestRouteRequest) Descriptor() ([]byte, []int)
Deprecated: Use TestRouteRequest.ProtoReflect.Descriptor instead.
func (x *TestRouteRequest) GetFieldSelectors() []string
func (x *TestRouteRequest) GetPublishResult() bool
func (x *TestRouteRequest) GetRoutingContext() *RoutingContext
func (*TestRouteRequest) ProtoMessage()
func (x *TestRouteRequest) ProtoReflect() protoreflect.Message
func (x *TestRouteRequest) Reset()
func (x *TestRouteRequest) String() string
type UnimplementedRoutingServiceServer struct { }
UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error
func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)
type UnsafeRoutingServiceServer interface {
// contains filtered or unexported methods
}
UnsafeRoutingServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RoutingServiceServer will result in compilation errors.
Package command imports 17 packages (graph) and is imported by 1 packages. Updated 2020-10-16. Refresh now. Tools for package owners.