Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(b []byte) uint32
- func MarshalCommand(command interface{}, writer io.Writer) error
- func UnmarshalCommand(cmdId byte, data []byte) (protocol.ResponseCommand, error)
- type ClientSession
- func (this *ClientSession) DecodeResponseBody(reader io.Reader) io.Reader
- func (this *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error)
- func (this *ClientSession) EncodeRequestBody(writer io.Writer) io.Writer
- func (this *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer)
- type CommandFactory
- type CommandSwitchAccountFactory
- type ServerSession
- func (this *ServerSession) DecodeRequestBody(reader io.Reader) io.Reader
- func (this *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error)
- func (this *ServerSession) EncodeResponseBody(writer io.Writer) io.Writer
- func (this *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, writer io.Writer)
- func (this *ServerSession) Release()
Constants ¶
View Source
const ( Version = byte(1) AddrTypeIPv4 = byte(0x01) AddrTypeIPv6 = byte(0x03) AddrTypeDomain = byte(0x02) )
Variables ¶
Functions ¶
func Authenticate ¶
func MarshalCommand ¶
func UnmarshalCommand ¶
func UnmarshalCommand(cmdId byte, data []byte) (protocol.ResponseCommand, error)
Types ¶
type ClientSession ¶
type ClientSession struct {
// contains filtered or unexported fields
}
func NewClientSession ¶
func NewClientSession(idHash protocol.IDHash) *ClientSession
func (*ClientSession) DecodeResponseBody ¶
func (this *ClientSession) DecodeResponseBody(reader io.Reader) io.Reader
func (*ClientSession) DecodeResponseHeader ¶
func (this *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error)
func (*ClientSession) EncodeRequestBody ¶
func (this *ClientSession) EncodeRequestBody(writer io.Writer) io.Writer
func (*ClientSession) EncodeRequestHeader ¶
func (this *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer)
type CommandFactory ¶
type CommandSwitchAccountFactory ¶
type CommandSwitchAccountFactory struct { }
func (*CommandSwitchAccountFactory) Marshal ¶
func (this *CommandSwitchAccountFactory) Marshal(command interface{}, writer io.Writer) error
func (*CommandSwitchAccountFactory) Unmarshal ¶
func (this *CommandSwitchAccountFactory) Unmarshal(data []byte) (interface{}, error)
type ServerSession ¶
type ServerSession struct {
// contains filtered or unexported fields
}
func NewServerSession ¶
func NewServerSession(validator protocol.UserValidator) *ServerSession
NewServerSession creates a new ServerSession, using the given UserValidator. The ServerSession instance doesn't take ownership of the validator.
func (*ServerSession) DecodeRequestBody ¶
func (this *ServerSession) DecodeRequestBody(reader io.Reader) io.Reader
func (*ServerSession) DecodeRequestHeader ¶
func (this *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error)
func (*ServerSession) EncodeResponseBody ¶
func (this *ServerSession) EncodeResponseBody(writer io.Writer) io.Writer
func (*ServerSession) EncodeResponseHeader ¶
func (this *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, writer io.Writer)
func (*ServerSession) Release ¶ added in v1.21.1
func (this *ServerSession) Release()
Release implements common.Releaseable.
Click to show internal directories.
Click to hide internal directories.