Versions in this module Expand all Collapse all v1 v1.9.1 Feb 28, 2016 Changes in this version + const IDBytesLen + const RequestCommandTCP + const RequestCommandUDP + const RequestOptionChunkStream + const UserLevelAdmin + const UserLevelUntrusted + var ErrorInvalidUser = errors.New("Invalid user.") + var ErrorInvalidVersion = errors.New("Invalid version.") + var InvalidID = errors.New("Invalid ID.") + func DefaultIDHash(key []byte) hash.Hash + type CommandSwitchAccount struct + AlterIds serial.Uint16Literal + Host v2net.Address + ID *uuid.UUID + Level UserLevel + Port v2net.Port + ValidMin byte + type ID struct + 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 RequestDecoder interface + DecodeRequestBody func(io.Reader) io.Reader + DecodeRequestHeader func(io.Reader) (*RequestHeader, error) + type RequestEncoder interface + EncodeRequestBody func(io.Writer) io.Writer + EncodeRequestHeader func(*RequestHeader, io.Writer) + 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) IsChunkStream() bool + type ResponseCommand interface + type ResponseDecoder interface + DecodeResponseBody func(io.Reader) io.Reader + DecodeResponseHeader func(io.Reader) (*ResponseHeader, error) + type ResponseEncoder interface + EncodeResponseBody func(io.Writer) io.Writer + EncodeResponseHeader func(*ResponseHeader, io.Writer) + type ResponseHeader struct + Command ResponseCommand + type TimedUserValidator struct + func (this *TimedUserValidator) Add(user *User) error + func (this *TimedUserValidator) Get(userHash []byte) (*User, Timestamp, bool) + type Timestamp int64 + func NowTime() Timestamp + func (this Timestamp) Bytes() []byte + type TimestampGenerator func() Timestamp + func NewTimestampGenerator(base Timestamp, delta int) TimestampGenerator + type User struct + AlterIDs []*ID + Email string + ID *ID + Level UserLevel + func NewUser(id *ID, level UserLevel, alterIdCount uint16, email string) *User + func (this *User) AnyValidID() *ID + 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) + func NewTimedUserValidator(hasher IDHash) UserValidator