message

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 2 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"`
	NodeID          string `json:"node-id" msg:"node-id"`
	ClientID        string `json:"client-id" msg:"client-id"`
	ProtocolVersion byte   `json:"protocol-version" msg:"protocol-version"`
	Payload         []byte `json:"payload" msg:"payload"`
}

func (*Message) JsonBytes

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

func (*Message) JsonLoad

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