Documentation ¶
Index ¶
- type MsgPackCodec
- type Packet
- func (z *Packet) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Packet) EncodeMsg(en *msgp.Writer) (err error)
- func (p *Packet) EventName() string
- func (p *Packet) ID() int
- func (p *Packet) Marshal() ([]byte, error)
- func (z *Packet) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Packet) Msgsize() (s int)
- func (p *Packet) Payload() []byte
- func (p *Packet) SetEventName(name string)
- func (p *Packet) SetID(id int)
- func (p *Packet) SetPayload(payload []byte)
- func (p *Packet) SetType(pType socketcrutch.PacketType)
- func (p *Packet) Type() socketcrutch.PacketType
- func (p *Packet) Unmarshal(data []byte) error
- func (z *Packet) UnmarshalMsg(bts []byte) (o []byte, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MsgPackCodec ¶
type MsgPackCodec struct{}
func (*MsgPackCodec) NewPacket ¶
func (_ *MsgPackCodec) NewPacket() socketcrutch.Packet
func (*MsgPackCodec) ReadMode ¶
func (_ *MsgPackCodec) ReadMode() int
func (*MsgPackCodec) WriteMode ¶
func (_ *MsgPackCodec) WriteMode() int
type Packet ¶
type Packet struct {
// contains filtered or unexported fields
}
packet is container for raw data and therefore holds the event name, the pointer to payload, the event type id, the packet id.
func (*Packet) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Packet) SetEventName ¶
func (*Packet) SetPayload ¶
func (*Packet) SetType ¶
func (p *Packet) SetType(pType socketcrutch.PacketType)
func (*Packet) Type ¶
func (p *Packet) Type() socketcrutch.PacketType
Click to show internal directories.
Click to hide internal directories.