network

package
v0.0.0-...-112ff1b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2014 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InboundPacket

type InboundPacket struct {
	SessionID uint16
	Sequence  uint16
	Parameter uint16
	// contains filtered or unexported fields
}

func NewInboundPacket

func NewInboundPacket(source []byte, typ constants.PacketType) *InboundPacket

func (*InboundPacket) Buffer

func (p *InboundPacket) Buffer() []byte

func (*InboundPacket) Code

func (p *InboundPacket) Code() constants.PacketCode

func (*InboundPacket) Finalize

func (p *InboundPacket) Finalize()

No-op function to satisfy the packet interface.

func (*InboundPacket) Len

func (p *InboundPacket) Len() int

func (*InboundPacket) ReadBoundedString

func (p *InboundPacket) ReadBoundedString(length int) (string, error)

func (*InboundPacket) ReadHInt16

func (p *InboundPacket) ReadHInt16() (int16, error)

func (*InboundPacket) ReadHInt32

func (p *InboundPacket) ReadHInt32() (int32, error)

func (*InboundPacket) ReadHInt64

func (p *InboundPacket) ReadHInt64() (int64, error)

func (*InboundPacket) ReadHUInt16

func (p *InboundPacket) ReadHUInt16() (uint16, error)

func (*InboundPacket) ReadHUInt32

func (p *InboundPacket) ReadHUInt32() (uint32, error)

func (*InboundPacket) ReadHUInt64

func (p *InboundPacket) ReadHUInt64() (uint64, error)

func (*InboundPacket) ReadInt16

func (p *InboundPacket) ReadInt16() (int16, error)

func (*InboundPacket) ReadInt32

func (p *InboundPacket) ReadInt32() (int32, error)

func (*InboundPacket) ReadInt64

func (p *InboundPacket) ReadInt64() (int64, error)

func (*InboundPacket) ReadInt8

func (p *InboundPacket) ReadInt8() (int8, error)

func (*InboundPacket) ReadLengthPrefixedString

func (p *InboundPacket) ReadLengthPrefixedString() (string, error)

func (*InboundPacket) ReadUInt16

func (p *InboundPacket) ReadUInt16() (uint16, error)

func (*InboundPacket) ReadUInt32

func (p *InboundPacket) ReadUInt32() (uint32, error)

func (*InboundPacket) ReadUInt64

func (p *InboundPacket) ReadUInt64() (uint64, error)

func (*InboundPacket) ReadUInt8

func (p *InboundPacket) ReadUInt8() (uint8, error)

func (*InboundPacket) Skip

func (p *InboundPacket) Skip(n int)

func (*InboundPacket) Type

func (p *InboundPacket) Type() constants.PacketType

type OutboundPacket

type OutboundPacket struct {
	// contains filtered or unexported fields
}

func NewOutboundPacket

func NewOutboundPacket(typ constants.PacketType, code constants.PacketCode) *OutboundPacket

func (*OutboundPacket) Buffer

func (p *OutboundPacket) Buffer() []byte

func (*OutboundPacket) Code

func (p *OutboundPacket) Code() constants.PacketCode

func (*OutboundPacket) Finalize

func (p *OutboundPacket) Finalize()

func (*OutboundPacket) Len

func (p *OutboundPacket) Len() int

func (*OutboundPacket) Type

func (p *OutboundPacket) Type() constants.PacketType

func (*OutboundPacket) WriteBoundedString

func (p *OutboundPacket) WriteBoundedString(val string, length int)

func (*OutboundPacket) WriteHInt16

func (p *OutboundPacket) WriteHInt16(val int16)

func (*OutboundPacket) WriteHInt32

func (p *OutboundPacket) WriteHInt32(val int32)

func (*OutboundPacket) WriteHInt64

func (p *OutboundPacket) WriteHInt64(val int64)

func (*OutboundPacket) WriteHUInt16

func (p *OutboundPacket) WriteHUInt16(val uint16)

func (*OutboundPacket) WriteHUInt32

func (p *OutboundPacket) WriteHUInt32(val uint32)

func (*OutboundPacket) WriteHUInt64

func (p *OutboundPacket) WriteHUInt64(val uint64)

func (*OutboundPacket) WriteInt16

func (p *OutboundPacket) WriteInt16(val int16)

func (*OutboundPacket) WriteInt32

func (p *OutboundPacket) WriteInt32(val int32)

func (*OutboundPacket) WriteInt64

func (p *OutboundPacket) WriteInt64(val int64)

func (*OutboundPacket) WriteLengthPrefixedString

func (p *OutboundPacket) WriteLengthPrefixedString(val string)

func (*OutboundPacket) WriteRepeated

func (p *OutboundPacket) WriteRepeated(val uint8, count int)

func (*OutboundPacket) WriteUInt16

func (p *OutboundPacket) WriteUInt16(val uint16)

func (*OutboundPacket) WriteUInt32

func (p *OutboundPacket) WriteUInt32(val uint32)

func (*OutboundPacket) WriteUInt64

func (p *OutboundPacket) WriteUInt64(val uint64)

func (*OutboundPacket) WriteUInt8

func (p *OutboundPacket) WriteUInt8(val uint8)

type PacketHandler

type PacketHandler func(client interfaces.Client, packet interfaces.Packet)

type PacketReader

type PacketReader struct {
	// contains filtered or unexported fields
}

func NewPacketReader

func NewPacketReader(conn io.Reader, counter metrics.Counter) *PacketReader

func (*PacketReader) Next

func (r *PacketReader) Next() (*InboundPacket, error)

type PacketWriter

type PacketWriter struct {
	// contains filtered or unexported fields
}

func NewPacketWriter

func NewPacketWriter(conn io.Writer, counter metrics.Counter) *PacketWriter

func (*PacketWriter) Write

func (w *PacketWriter) Write(p interfaces.Packet) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL