Documentation ¶
Index ¶
- Constants
- func NewFullReader(reader io.Reader) (this io.Reader)
- func ReadBool(reader io.Reader, util []byte) (val bool, err error)
- func ReadInt16(reader io.Reader, util []byte) (val int16, err error)
- func ReadInt32(reader io.Reader, util []byte) (val int32, err error)
- func ReadInt64(reader io.Reader, util []byte) (val int64, err error)
- func ReadInt8(reader io.Reader, util []byte) (val int8, err error)
- func ReadString(reader io.Reader, util []byte) (val string, err error)
- func ReadUUID(reader io.Reader, util []byte) (result uuid.UUID, err error)
- func ReadUint16(reader io.Reader, util []byte) (val uint16, err error)
- func ReadUint32(reader io.Reader, util []byte) (val uint32, err error)
- func ReadUint64(reader io.Reader, util []byte) (val uint64, err error)
- func ReadUint8(reader io.Reader, util []byte) (val uint8, err error)
- func ReadVarInt(reader io.Reader, util []byte) (result int, err error)
- func WriteBool(writer io.Writer, util []byte, val bool) (err error)
- func WriteInt16(writer io.Writer, util []byte, val int16) (err error)
- func WriteInt32(writer io.Writer, util []byte, val int32) (err error)
- func WriteInt64(writer io.Writer, util []byte, val int64) (err error)
- func WriteInt8(writer io.Writer, util []byte, val int8) (err error)
- func WriteString(writer io.Writer, util []byte, val string) (err error)
- func WriteUUID(writer io.Writer, util []byte, val uuid.UUID) (err error)
- func WriteUint16(writer io.Writer, util []byte, val uint16) (err error)
- func WriteUint32(writer io.Writer, util []byte, val uint32) (err error)
- func WriteUint64(writer io.Writer, util []byte, val uint64) (err error)
- func WriteUint8(writer io.Writer, util []byte, val uint8) (err error)
- func WriteVarInt(writer io.Writer, util []byte, val int) (err error)
- type Packet
- type PacketCodec
- type PacketCodecRegistry
- func (this *PacketCodecRegistry) Copy() (thisCopy *PacketCodecRegistry)
- func (this *PacketCodecRegistry) Decode(reader io.Reader, util []byte) (packet Packet, err error)
- func (this *PacketCodecRegistry) Encode(writer io.Writer, util []byte, packet Packet) (err error)
- func (this *PacketCodecRegistry) Flip() (thisCopy *PacketCodecRegistry)
- func (this *PacketCodecRegistry) SetCodec(codec PacketCodec)
- type PacketCodecVarIntLength
- type PacketCodecZlib
- type PacketConnCodec
- type PacketHandler
- type PacketPipeline
- func (this *PacketPipeline) AddAfter(name string, subject string, child PacketPipelineChild) (err error)
- func (this *PacketPipeline) AddBefore(name string, subject string, child PacketPipelineChild) (err error)
- func (this *PacketPipeline) AddFirst(name string, child PacketPipelineChild) (err error)
- func (this *PacketPipeline) AddLast(name string, child PacketPipelineChild) (err error)
- func (this *PacketPipeline) Decode(reader io.Reader, util []byte) (packet Packet, err error)
- func (this *PacketPipeline) Encode(writer io.Writer, util []byte, packet Packet) (err error)
- func (this *PacketPipeline) Get(name string) (child PacketPipelineChild)
- func (this *PacketPipeline) HasName(name string) (ok bool)
- func (this *PacketPipeline) Remove(name string) (err error)
- func (this *PacketPipeline) Replace(name string, child PacketPipelineChild) (err error)
- type PacketPipelineChild
Constants ¶
View Source
const (
UTIL_BUFFER_LENGTH = 8
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type PacketCodec ¶
type PacketCodecRegistry ¶
type PacketCodecRegistry struct { EncodeCodecs []PacketCodec DecodeCodecs []PacketCodec }
func NewPacketCodecRegistry ¶
func NewPacketCodecRegistry(codecs []PacketCodec) (this *PacketCodecRegistry)
func NewPacketCodecRegistryDual ¶
func NewPacketCodecRegistryDual(encodeCodecs []PacketCodec, decodeCodecs []PacketCodec) (this *PacketCodecRegistry)
func (*PacketCodecRegistry) Copy ¶
func (this *PacketCodecRegistry) Copy() (thisCopy *PacketCodecRegistry)
func (*PacketCodecRegistry) Flip ¶
func (this *PacketCodecRegistry) Flip() (thisCopy *PacketCodecRegistry)
func (*PacketCodecRegistry) SetCodec ¶
func (this *PacketCodecRegistry) SetCodec(codec PacketCodec)
type PacketCodecVarIntLength ¶
type PacketCodecVarIntLength struct {
// contains filtered or unexported fields
}
func NewPacketCodecVarIntLength ¶
func NewPacketCodecVarIntLength() (this *PacketCodecVarIntLength)
func (*PacketCodecVarIntLength) SetCodec ¶
func (this *PacketCodecVarIntLength) SetCodec(codec PacketCodec)
type PacketCodecZlib ¶
type PacketCodecZlib struct {
// contains filtered or unexported fields
}
func NewPacketCodecZlib ¶
func NewPacketCodecZlib(threshold int) (this *PacketCodecZlib)
func NewPacketCodecZlibLevel ¶
func NewPacketCodecZlibLevel(threshold int, level int) (this *PacketCodecZlib)
func (*PacketCodecZlib) SetCodec ¶
func (this *PacketCodecZlib) SetCodec(codec PacketCodec)
type PacketConnCodec ¶
type PacketConnCodec struct { Reader io.Reader Writer io.Writer // contains filtered or unexported fields }
func NewPacketConnCodec ¶
func NewPacketConnCodec(conn net.Conn, packetCodec PacketCodec, timeout time.Duration) (this *PacketConnCodec)
func (*PacketConnCodec) ReadConn ¶
func (this *PacketConnCodec) ReadConn(packetHandler PacketHandler)
func (*PacketConnCodec) Write ¶
func (this *PacketConnCodec) Write(packet Packet) (err error)
type PacketHandler ¶
type PacketPipeline ¶
type PacketPipeline struct {
// contains filtered or unexported fields
}
func NewPacketPipeline ¶
func NewPacketPipeline() (this *PacketPipeline)
func (*PacketPipeline) AddAfter ¶
func (this *PacketPipeline) AddAfter(name string, subject string, child PacketPipelineChild) (err error)
func (*PacketPipeline) AddBefore ¶
func (this *PacketPipeline) AddBefore(name string, subject string, child PacketPipelineChild) (err error)
func (*PacketPipeline) AddFirst ¶
func (this *PacketPipeline) AddFirst(name string, child PacketPipelineChild) (err error)
func (*PacketPipeline) AddLast ¶
func (this *PacketPipeline) AddLast(name string, child PacketPipelineChild) (err error)
func (*PacketPipeline) Get ¶
func (this *PacketPipeline) Get(name string) (child PacketPipelineChild)
func (*PacketPipeline) HasName ¶
func (this *PacketPipeline) HasName(name string) (ok bool)
func (*PacketPipeline) Remove ¶
func (this *PacketPipeline) Remove(name string) (err error)
func (*PacketPipeline) Replace ¶
func (this *PacketPipeline) Replace(name string, child PacketPipelineChild) (err error)
type PacketPipelineChild ¶
type PacketPipelineChild interface { PacketCodec SetCodec(codec PacketCodec) }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.