Versions in this module Expand all Collapse all v0 v0.0.1 May 10, 2024 Changes in this version + var DefaultCodec = new(MsgCodec) + func DecodeMsg(data []byte, msg api.Message) (err error) + func DecodeMsgContext(data []byte, msgType api.MessageType) (context uint32, err error) + func EncodeMsg(msg api.Message, msgID uint16) (data []byte, err error) + type Buffer struct + func NewBuffer(b []byte) *Buffer + func (b *Buffer) Bytes() []byte + func (b *Buffer) DecodeBool() bool + func (b *Buffer) DecodeBytes(length int) []byte + func (b *Buffer) DecodeFloat64() float64 + func (b *Buffer) DecodeInt16() int16 + func (b *Buffer) DecodeInt32() int32 + func (b *Buffer) DecodeInt64() int64 + func (b *Buffer) DecodeInt8() int8 + func (b *Buffer) DecodeString(length int) string + func (b *Buffer) DecodeUint16() uint16 + func (b *Buffer) DecodeUint32() uint32 + func (b *Buffer) DecodeUint64() uint64 + func (b *Buffer) DecodeUint8() uint8 + func (b *Buffer) EncodeBool(v bool) + func (b *Buffer) EncodeBytes(v []byte, length int) + func (b *Buffer) EncodeFloat64(v float64) + func (b *Buffer) EncodeInt16(v int16) + func (b *Buffer) EncodeInt32(v int32) + func (b *Buffer) EncodeInt64(v int64) + func (b *Buffer) EncodeInt8(v int8) + func (b *Buffer) EncodeString(v string, length int) + func (b *Buffer) EncodeUint16(v uint16) + func (b *Buffer) EncodeUint32(v uint32) + func (b *Buffer) EncodeUint64(v uint64) + func (b *Buffer) EncodeUint8(v uint8) + type Marshaler interface + Marshal func([]byte) ([]byte, error) + Size func() int + type MsgCodec struct + func (*MsgCodec) DecodeMsg(data []byte, msg api.Message) (err error) + func (*MsgCodec) DecodeMsgContext(data []byte, msgType api.MessageType) (context uint32, err error) + func (*MsgCodec) EncodeMsg(msg api.Message, msgID uint16) (data []byte, err error) + type Unmarshaler interface + Unmarshal func([]byte) error + type Wrapper struct + func (w Wrapper) Marshal(b []byte) ([]byte, error) + func (w Wrapper) Size() int + func (w Wrapper) Unmarshal(data []byte) error