v2ray-core: github.com/v2ray/v2ray-core/app/router/command Index | Files

package command

import "github.com/v2ray/v2ray-core/app/router/command"

Index

Package Files

command.go command.pb.go command_grpc.pb.go config.go errors.generated.go

Variables

var File_app_router_command_command_proto protoreflect.FileDescriptor

func AsProtobufMessage Uses

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 Uses

func AsRoutingContext(r *RoutingContext) routing.Context

AsRoutingContext converts a protobuf RoutingContext into an implementation of routing.Context.

func AsRoutingRoute Uses

func AsRoutingRoute(r *RoutingContext) routing.Route

AsRoutingRoute converts a protobuf RoutingContext into an implementation of routing.Route.

func RegisterRoutingServiceServer Uses

func RegisterRoutingServiceServer(s *grpc.Server, srv RoutingServiceServer)

type Config Uses

type Config struct {
    // contains filtered or unexported fields
}

func (*Config) Descriptor Uses

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) ProtoMessage Uses

func (*Config) ProtoMessage()

func (*Config) ProtoReflect Uses

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset Uses

func (x *Config) Reset()

func (*Config) String Uses

func (x *Config) String() string

type RoutingContext Uses

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 Uses

func (*RoutingContext) Descriptor() ([]byte, []int)

Deprecated: Use RoutingContext.ProtoReflect.Descriptor instead.

func (*RoutingContext) GetAttributes Uses

func (x *RoutingContext) GetAttributes() map[string]string

func (*RoutingContext) GetInboundTag Uses

func (x *RoutingContext) GetInboundTag() string

func (*RoutingContext) GetNetwork Uses

func (x *RoutingContext) GetNetwork() net.Network

func (*RoutingContext) GetOutboundGroupTags Uses

func (x *RoutingContext) GetOutboundGroupTags() []string

func (*RoutingContext) GetOutboundTag Uses

func (x *RoutingContext) GetOutboundTag() string

func (*RoutingContext) GetProtocol Uses

func (x *RoutingContext) GetProtocol() string

func (*RoutingContext) GetSourceIPs Uses

func (x *RoutingContext) GetSourceIPs() [][]byte

func (*RoutingContext) GetSourcePort Uses

func (x *RoutingContext) GetSourcePort() uint32

func (*RoutingContext) GetTargetDomain Uses

func (x *RoutingContext) GetTargetDomain() string

func (*RoutingContext) GetTargetIPs Uses

func (x *RoutingContext) GetTargetIPs() [][]byte

func (*RoutingContext) GetTargetPort Uses

func (x *RoutingContext) GetTargetPort() uint32

func (*RoutingContext) GetUser Uses

func (x *RoutingContext) GetUser() string

func (*RoutingContext) ProtoMessage Uses

func (*RoutingContext) ProtoMessage()

func (*RoutingContext) ProtoReflect Uses

func (x *RoutingContext) ProtoReflect() protoreflect.Message

func (*RoutingContext) Reset Uses

func (x *RoutingContext) Reset()

func (*RoutingContext) String Uses

func (x *RoutingContext) String() string

type RoutingServiceClient Uses

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 Uses

func NewRoutingServiceClient(cc grpc.ClientConnInterface) RoutingServiceClient

type RoutingServiceServer Uses

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

func NewRoutingServer Uses

func NewRoutingServer(router routing.Router, routingStats stats.Channel) RoutingServiceServer

NewRoutingServer creates a statistics service with statistics manager.

type RoutingService_SubscribeRoutingStatsClient Uses

type RoutingService_SubscribeRoutingStatsClient interface {
    Recv() (*RoutingContext, error)
    grpc.ClientStream
}

type RoutingService_SubscribeRoutingStatsServer Uses

type RoutingService_SubscribeRoutingStatsServer interface {
    Send(*RoutingContext) error
    grpc.ServerStream
}

type SubscribeRoutingStatsRequest Uses

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 Uses

func (*SubscribeRoutingStatsRequest) Descriptor() ([]byte, []int)

Deprecated: Use SubscribeRoutingStatsRequest.ProtoReflect.Descriptor instead.

func (*SubscribeRoutingStatsRequest) GetFieldSelectors Uses

func (x *SubscribeRoutingStatsRequest) GetFieldSelectors() []string

func (*SubscribeRoutingStatsRequest) ProtoMessage Uses

func (*SubscribeRoutingStatsRequest) ProtoMessage()

func (*SubscribeRoutingStatsRequest) ProtoReflect Uses

func (x *SubscribeRoutingStatsRequest) ProtoReflect() protoreflect.Message

func (*SubscribeRoutingStatsRequest) Reset Uses

func (x *SubscribeRoutingStatsRequest) Reset()

func (*SubscribeRoutingStatsRequest) String Uses

func (x *SubscribeRoutingStatsRequest) String() string

type TestRouteRequest Uses

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 Uses

func (*TestRouteRequest) Descriptor() ([]byte, []int)

Deprecated: Use TestRouteRequest.ProtoReflect.Descriptor instead.

func (*TestRouteRequest) GetFieldSelectors Uses

func (x *TestRouteRequest) GetFieldSelectors() []string

func (*TestRouteRequest) GetPublishResult Uses

func (x *TestRouteRequest) GetPublishResult() bool

func (*TestRouteRequest) GetRoutingContext Uses

func (x *TestRouteRequest) GetRoutingContext() *RoutingContext

func (*TestRouteRequest) ProtoMessage Uses

func (*TestRouteRequest) ProtoMessage()

func (*TestRouteRequest) ProtoReflect Uses

func (x *TestRouteRequest) ProtoReflect() protoreflect.Message

func (*TestRouteRequest) Reset Uses

func (x *TestRouteRequest) Reset()

func (*TestRouteRequest) String Uses

func (x *TestRouteRequest) String() string

type UnimplementedRoutingServiceServer Uses

type UnimplementedRoutingServiceServer struct {
}

UnimplementedRoutingServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedRoutingServiceServer) SubscribeRoutingStats Uses

func (UnimplementedRoutingServiceServer) SubscribeRoutingStats(*SubscribeRoutingStatsRequest, RoutingService_SubscribeRoutingStatsServer) error

func (UnimplementedRoutingServiceServer) TestRoute Uses

func (UnimplementedRoutingServiceServer) TestRoute(context.Context, *TestRouteRequest) (*RoutingContext, error)

type UnsafeRoutingServiceServer Uses

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). Updated 2020-10-31. Refresh now. Tools for package owners.