commander

package
v3.46.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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) Start

func (c *Commander) Start() error

Start implements common.Runnable.

func (*Commander) Type added in v3.11.1

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

Type implements common.HasType.

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              []*serial.TypedMessage `protobuf:"bytes,2,rep,name=service,proto3" json:"service,omitempty"`
	XXX_NoUnkeyedLiteral struct{}               `json:"-"`
	XXX_unrecognized     []byte                 `json:"-"`
	XXX_sizecache        int32                  `json:"-"`
}

Config is the settings for Commander.

func (*Config) Descriptor

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

func (*Config) GetService

func (m *Config) GetService() []*serial.TypedMessage

func (*Config) GetTag

func (m *Config) GetTag() string

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) Reset

func (m *Config) Reset()

func (*Config) String

func (m *Config) String() string

func (*Config) XXX_DiscardUnknown added in v3.23.1

func (m *Config) XXX_DiscardUnknown()

func (*Config) XXX_Marshal added in v3.23.1

func (m *Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Config) XXX_Merge added in v3.23.1

func (m *Config) XXX_Merge(src proto.Message)

func (*Config) XXX_Size added in v3.23.1

func (m *Config) XXX_Size() int

func (*Config) XXX_Unmarshal added in v3.23.1

func (m *Config) XXX_Unmarshal(b []byte) error

type Outbound added in v3.17.1

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

Outbound is a core.OutboundHandler that handles gRPC connections.

func (*Outbound) Close added in v3.17.1

func (co *Outbound) Close() error

Close implements common.Closable.

func (*Outbound) Dispatch added in v3.17.1

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

Dispatch implements core.OutboundHandler.

func (*Outbound) Start added in v3.17.1

func (co *Outbound) Start() error

Start implements common.Runnable.

func (*Outbound) Tag added in v3.17.1

func (co *Outbound) Tag() string

Tag implements core.OutboundHandler.

type OutboundListener

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

OutboundListener is a net.Listener for listening gRPC connections.

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 Service

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

Service is a Commander service.

Jump to

Keyboard shortcuts

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