codec

package
v0.0.0-...-1b013b7 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

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) DecodeMsg

func (z *Packet) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Packet) EncodeMsg

func (z *Packet) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Packet) EventName

func (p *Packet) EventName() string

func (*Packet) ID

func (p *Packet) ID() int

func (*Packet) Marshal

func (p *Packet) Marshal() ([]byte, error)

func (*Packet) MarshalMsg

func (z *Packet) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Packet) Msgsize

func (z *Packet) Msgsize() (s int)

func (*Packet) Payload

func (p *Packet) Payload() []byte

func (*Packet) SetEventName

func (p *Packet) SetEventName(name string)

func (*Packet) SetID

func (p *Packet) SetID(id int)

func (*Packet) SetPayload

func (p *Packet) SetPayload(payload []byte)

func (*Packet) SetType

func (p *Packet) SetType(pType socketcrutch.PacketType)

func (*Packet) Type

func (p *Packet) Type() socketcrutch.PacketType

func (*Packet) Unmarshal

func (p *Packet) Unmarshal(data []byte) error

func (*Packet) UnmarshalMsg

func (z *Packet) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

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