commander

package
v5.55.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 21 Imported by: 4 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_app_commander_config_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Commander

type Commander struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Commander is a V2Ray feature that provides gRPC methods to external clients.

func NewCommander

func NewCommander(ctx context.Context, config *Config) (*Commander, error)

NewCommander creates a new Commander based on the given config.

func (*Commander) Close

func (c *Commander) Close() error

Close implements common.Closable.

func (*Commander) ExtractGrpcServer added in v5.25.0

func (c *Commander) ExtractGrpcServer() *grpc.Server

ExtractGrpcServer extracts the gRPC server from Commander. Private function for core code base.

func (*Commander) Start

func (c *Commander) Start() error

Start implements common.Runnable.

func (*Commander) Type

func (c *Commander) Type() interface{}

Type implements common.HasType.

type CommanderIfce added in v5.25.0

type CommanderIfce interface {
	features.Feature

	ExtractGrpcServer() *grpc.Server
}

type Config

type Config struct {

	// Tag of the outbound handler that handles grpc connections.
	Tag string `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	// Services that supported by this server. All services must implement Service
	// interface.
	Service []*anypb.Any `protobuf:"bytes,2,rep,name=service,proto3" json:"service,omitempty"`
	// contains filtered or unexported fields
}

Config is the settings for Commander.

func (*Config) Descriptor deprecated

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

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetService

func (x *Config) GetService() []*anypb.Any

func (*Config) GetTag

func (x *Config) GetTag() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

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

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Outbound

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

Outbound is a outbound.Handler that handles gRPC connections.

func NewOutbound added in v5.25.0

func NewOutbound(tag string, listener *OutboundListener) *Outbound

func (*Outbound) Close

func (co *Outbound) Close() error

Close implements common.Closable.

func (*Outbound) Dispatch

func (co *Outbound) Dispatch(ctx context.Context, link *transport.Link)

Dispatch implements outbound.Handler.

func (*Outbound) Start

func (co *Outbound) Start() error

Start implements common.Runnable.

func (*Outbound) Tag

func (co *Outbound) Tag() string

Tag implements outbound.Handler.

type OutboundListener

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

OutboundListener is a net.Listener for listening gRPC connections.

func NewOutboundListener added in v5.25.0

func NewOutboundListener() *OutboundListener

func (*OutboundListener) Accept

func (l *OutboundListener) Accept() (net.Conn, error)

Accept implements net.Listener.

func (*OutboundListener) Addr

func (l *OutboundListener) Addr() net.Addr

Addr implements net.Listener.

func (*OutboundListener) Close

func (l *OutboundListener) Close() error

Close implement net.Listener.

type ReflectionConfig

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

ReflectionConfig is the placeholder config for ReflectionService.

func (*ReflectionConfig) Descriptor deprecated

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

Deprecated: Use ReflectionConfig.ProtoReflect.Descriptor instead.

func (*ReflectionConfig) ProtoMessage

func (*ReflectionConfig) ProtoMessage()

func (*ReflectionConfig) ProtoReflect

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

func (*ReflectionConfig) Reset

func (x *ReflectionConfig) Reset()

func (*ReflectionConfig) String

func (x *ReflectionConfig) String() string

type Service

type Service interface {
	// Register registers the service itself to a gRPC server.
	Register(*grpc.Server)
}

Service is a Commander service.

type SimplifiedConfig

type SimplifiedConfig struct {
	Tag  string   `protobuf:"bytes,1,opt,name=tag,proto3" json:"tag,omitempty"`
	Name []string `protobuf:"bytes,2,rep,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*SimplifiedConfig) Descriptor deprecated

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

Deprecated: Use SimplifiedConfig.ProtoReflect.Descriptor instead.

func (*SimplifiedConfig) GetName

func (x *SimplifiedConfig) GetName() []string

func (*SimplifiedConfig) GetTag

func (x *SimplifiedConfig) GetTag() string

func (*SimplifiedConfig) ProtoMessage

func (*SimplifiedConfig) ProtoMessage()

func (*SimplifiedConfig) ProtoReflect

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

func (*SimplifiedConfig) Reset

func (x *SimplifiedConfig) Reset()

func (*SimplifiedConfig) String

func (x *SimplifiedConfig) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL