Documentation
¶
Index ¶
- type Packet
- func (p *Packet) ReadBool() bool
- func (p *Packet) ReadByte() byte
- func (p *Packet) ReadBytes(amount int) []byte
- func (p *Packet) ReadFloat() float32
- func (p *Packet) ReadInt16() int16
- func (p *Packet) ReadInt32() int32
- func (p *Packet) ReadInt64() int64
- func (p *Packet) ReadString() string
- func (p *Packet) ReadUInt16() uint16
- func (p *Packet) ReadUInt32() uint32
- func (p *Packet) ReadUInt64() uint64
- func (p *Packet) ResizeBuffer(size, keep, index int)
- func (p *Packet) WriteBool(b bool)
- func (p *Packet) WriteByte(d byte)
- func (p *Packet) WriteFloat(f float32)
- func (p *Packet) WriteInt16(i int16)
- func (p *Packet) WriteInt32(i int32)
- func (p *Packet) WriteInt64(i int64)
- func (p *Packet) WriteString(s string)
- func (p *Packet) WriteUInt16(i uint16)
- func (p *Packet) WriteUInt32(i uint32)
- func (p *Packet) WriteUInt64(i uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Packet ¶
Packet is a struct containing an underlying bytes buffer
func (*Packet) ReadString ¶
ReadString reads the expected string size (n) and read until n
func (*Packet) ReadUInt16 ¶
func (*Packet) ReadUInt32 ¶
func (*Packet) ReadUInt64 ¶
func (*Packet) ResizeBuffer ¶
ResizeBuffer resizes our packet data to the specified size Feel free to customize this function, as it can be tailored to many individual needs
size: the new size of the bytes buffer keep: the number of bytes to keep in the new buffer. Default: 0 index: the index to start from in the old byte buffer. Default: 0
func (*Packet) WriteFloat ¶
WriteFloat writes 4 bytes representing a float
func (*Packet) WriteInt16 ¶
func (*Packet) WriteInt32 ¶
func (*Packet) WriteInt64 ¶
func (*Packet) WriteString ¶
WriteString writes int16 (len of string) and then the contents of s as bytes