message

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// 0~20 corresponds to mqtt control package types
	MqttPublish = 3
	// 21~
	Reserved byte = iota + 21
	RaftJoin
	RaftApply
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type byte   `json:"type" msg:"type"`
	Data []byte `json:"data" msg:"data"`
}

func (*Message) Bytes

func (m *Message) Bytes() []byte

func (*Message) DecodeMsg

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

DecodeMsg implements msgp.Decodable

func (*Message) EncodeMsg

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

EncodeMsg implements msgp.Encodable

func (*Message) JsonBytes

func (m *Message) JsonBytes() []byte

func (*Message) JsonLoad

func (m *Message) JsonLoad(data []byte) error

func (*Message) Load

func (m *Message) Load(data []byte) error

func (*Message) MarshalMsg

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

MarshalMsg implements msgp.Marshaler

func (*Message) MsgpackBytes

func (m *Message) MsgpackBytes() []byte

func (*Message) MsgpackLoad

func (m *Message) MsgpackLoad(data []byte) error

func (*Message) Msgsize

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

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Message) UnmarshalMsg

func (z *Message) 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