Versions in this module Expand all Collapse all v1 v1.4.4 Aug 10, 2021 Changes in this version + const IDBytesLen + const RequestCommandMux + const RequestCommandTCP + const RequestCommandUDP + const RequestOptionChunkMasking + const RequestOptionChunkStream + const RequestOptionConnectionReuse + const RequestOptionGlobalPadding + const ResponseOptionConnectionReuse + var File_common_protocol_headers_proto protoreflect.FileDescriptor + var File_common_protocol_server_spec_proto protoreflect.FileDescriptor + var File_common_protocol_user_proto protoreflect.FileDescriptor + var SecurityType_name = map[int32]string + var SecurityType_value = map[string]int32 + func ContextWithRequestHeader(ctx context.Context, request *RequestHeader) context.Context + func DefaultIDHash(key []byte) hash.Hash + type Account interface + Equals func(Account) bool + type AddressOption func(*option) + func AddressFamilyByte(b byte, f net.AddressFamily) AddressOption + func PortThenAddress() AddressOption + func WithAddressTypeParser(atp AddressTypeParser) AddressOption + type AddressSerializer interface + ReadAddressPort func(buffer *buf.Buffer, input io.Reader) (net.Address, net.Port, error) + WriteAddressPort func(writer io.Writer, addr net.Address, port net.Port) error + func NewAddressParser(options ...AddressOption) AddressSerializer + type AddressType byte + const AddressTypeDomain + const AddressTypeIPv4 + const AddressTypeIPv6 + type AddressTypeParser func(byte) byte + type AsAccount interface + AsAccount func() (Account, error) + type CommandSwitchAccount struct + AlterIds uint16 + Host net.Address + ID uuid.UUID + Level uint32 + Port net.Port + ValidMin byte + type ID struct + func NewAlterIDs(primary *ID, alterIDCount uint16) []*ID + func NewID(uuid uuid.UUID) *ID + func (id *ID) Bytes() []byte + func (id *ID) Equals(another *ID) bool + func (id *ID) String() string + func (id *ID) UUID() uuid.UUID + func (id ID) CmdKey() []byte + type IDHash func(key []byte) hash.Hash + type MemoryUser struct + Account Account + Email string + Level uint32 + type RequestCommand byte + func (c RequestCommand) TransferType() TransferType + type RequestHeader struct + Address net.Address + Command RequestCommand + Option bitmask.Byte + Port net.Port + Security SecurityType + User *MemoryUser + Version byte + func RequestHeaderFromContext(ctx context.Context) *RequestHeader + func (h *RequestHeader) Destination() net.Destination + type ResponseCommand interface + type ResponseHeader struct + Command ResponseCommand + Option bitmask.Byte + type RoundRobinServerPicker struct + func NewRoundRobinServerPicker(serverlist *ServerList) *RoundRobinServerPicker + func (p *RoundRobinServerPicker) PickServer() *ServerSpec + type SecurityConfig struct + Type SecurityType + func (*SecurityConfig) Descriptor() ([]byte, []int) + func (*SecurityConfig) ProtoMessage() + func (sc *SecurityConfig) GetSecurityType() SecurityType + func (x *SecurityConfig) GetType() SecurityType + func (x *SecurityConfig) ProtoReflect() protoreflect.Message + func (x *SecurityConfig) Reset() + func (x *SecurityConfig) String() string + type SecurityType int32 + const SecurityType_AES128_GCM + const SecurityType_AUTO + const SecurityType_CHACHA20_POLY1305 + const SecurityType_LEGACY + const SecurityType_NONE + const SecurityType_UNKNOWN + const SecurityType_ZERO + func (SecurityType) Descriptor() protoreflect.EnumDescriptor + func (SecurityType) EnumDescriptor() ([]byte, []int) + func (SecurityType) Type() protoreflect.EnumType + func (x SecurityType) Enum() *SecurityType + func (x SecurityType) Number() protoreflect.EnumNumber + func (x SecurityType) String() string + type ServerEndpoint struct + Address *net.IPOrDomain + Port uint32 + User []*User + func (*ServerEndpoint) Descriptor() ([]byte, []int) + func (*ServerEndpoint) ProtoMessage() + func (x *ServerEndpoint) GetAddress() *net.IPOrDomain + func (x *ServerEndpoint) GetPort() uint32 + func (x *ServerEndpoint) GetUser() []*User + func (x *ServerEndpoint) ProtoReflect() protoreflect.Message + func (x *ServerEndpoint) Reset() + func (x *ServerEndpoint) String() string + type ServerList struct + func NewServerList() *ServerList + func (sl *ServerList) AddServer(server *ServerSpec) + func (sl *ServerList) GetServer(idx uint32) *ServerSpec + func (sl *ServerList) Size() uint32 + type ServerPicker interface + PickServer func() *ServerSpec + type ServerSpec struct + func NewServerSpec(dest net.Destination, valid ValidationStrategy, users ...*MemoryUser) *ServerSpec + func NewServerSpecFromPB(spec *ServerEndpoint) (*ServerSpec, error) + func (s *ServerSpec) AddUser(user *MemoryUser) + func (s *ServerSpec) Destination() net.Destination + func (s *ServerSpec) HasUser(user *MemoryUser) bool + func (s *ServerSpec) Invalidate() + func (s *ServerSpec) IsValid() bool + func (s *ServerSpec) PickUser() *MemoryUser + type Timestamp int64 + func NowTime() Timestamp + type TimestampGenerator func() Timestamp + func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator + type TransferType byte + const TransferTypePacket + const TransferTypeStream + type User struct + Account *serial.TypedMessage + Email string + Level uint32 + func (*User) Descriptor() ([]byte, []int) + func (*User) ProtoMessage() + func (u *User) GetTypedAccount() (Account, error) + func (u *User) ToMemoryUser() (*MemoryUser, error) + func (x *User) GetAccount() *serial.TypedMessage + func (x *User) GetEmail() string + func (x *User) GetLevel() uint32 + func (x *User) ProtoReflect() protoreflect.Message + func (x *User) Reset() + func (x *User) String() string + type ValidationStrategy interface + Invalidate func() + IsValid func() bool + func AlwaysValid() ValidationStrategy + func BeforeTime(t time.Time) ValidationStrategy