Versions in this module Expand all Collapse all v1 v1.24.4 Aug 19, 2016 Changes in this version + const IDBytesLen + const RequestCommandTCP + const RequestCommandUDP + const RequestOptionChunkStream + const RequestOptionConnectionReuse + const ResponseOptionConnectionReuse + const UserLevelAdmin + const UserLevelUntrusted + var ErrInvalidUser = errors.New("Invalid user.") + var ErrInvalidVersion = errors.New("Invalid version.") + var InvalidID = errors.New("Invalid ID.") + func DefaultIDHash(key []byte) hash.Hash + type Account interface + Equals func(Account) bool + type AlwaysValidStrategy struct + func (this AlwaysValidStrategy) Invalidate() + func (this AlwaysValidStrategy) IsValid() bool + type CommandSwitchAccount struct + AlterIds uint16 + Host v2net.Address + ID *uuid.UUID + Level UserLevel + Port v2net.Port + ValidMin byte + type ID struct + func NewAlterIDs(primary *ID, alterIDCount uint16) []*ID + func NewID(uuid *uuid.UUID) *ID + func (this *ID) Bytes() []byte + func (this *ID) Equals(another *ID) bool + func (this *ID) String() string + func (this *ID) UUID() *uuid.UUID + func (v ID) CmdKey() []byte + type IDHash func(key []byte) hash.Hash + type RequestCommand byte + type RequestHeader struct + Address v2net.Address + Command RequestCommand + Option RequestOption + Port v2net.Port + User *User + Version byte + func (this *RequestHeader) Destination() v2net.Destination + type RequestOption byte + func (this *RequestOption) Clear(option RequestOption) + func (this *RequestOption) Set(option RequestOption) + func (this RequestOption) Has(option RequestOption) bool + type ResponseCommand interface + type ResponseHeader struct + Command ResponseCommand + Option ResponseOption + type ResponseOption byte + func (this *ResponseOption) Clear(option ResponseOption) + func (this *ResponseOption) Set(option ResponseOption) + func (this ResponseOption) Has(option ResponseOption) bool + type RoundRobinServerPicker struct + func NewRoundRobinServerPicker(serverlist *ServerList) *RoundRobinServerPicker + func (this *RoundRobinServerPicker) PickServer() *ServerSpec + type ServerList struct + func NewServerList() *ServerList + func (this *ServerList) AddServer(server *ServerSpec) + func (this *ServerList) GetServer(idx uint32) *ServerSpec + func (this *ServerList) RemoveServer(idx uint32) + func (this *ServerList) Size() uint32 + type ServerPicker interface + PickServer func() *ServerSpec + type ServerSpec struct + func NewServerSpec(dest v2net.Destination, valid ValidationStrategy, users ...*User) *ServerSpec + func (this *ServerSpec) AddUser(user *User) + func (this *ServerSpec) Destination() v2net.Destination + func (this *ServerSpec) HasUser(user *User) bool + func (this *ServerSpec) Invalidate() + func (this *ServerSpec) IsValid() bool + func (this *ServerSpec) PickUser() *User + type TimeoutValidStrategy struct + func (this *TimeoutValidStrategy) Invalidate() + func (this *TimeoutValidStrategy) IsValid() bool + type Timestamp int64 + func NowTime() Timestamp + func (this Timestamp) Bytes(b []byte) []byte + type TimestampGenerator func() Timestamp + func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator + type User struct + Account Account + Email string + Level UserLevel + func NewUser(level UserLevel, email string) *User + type UserLevel byte + type UserSettings struct + PayloadReadTimeout int + func GetUserSettings(level UserLevel) UserSettings + type UserValidator interface + Add func(user *User) error + Get func(timeHash []byte) (*User, Timestamp, bool) + type ValidationStrategy interface + Invalidate func() + IsValid func() bool + func AlwaysValid() ValidationStrategy + func BeforeTime(t time.Time) ValidationStrategy Incompatible versions in this module v3.50.2+incompatible Oct 29, 2018 Other modules containing this package github.com/unifyproxy/v2ray-core/v4