message

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: MulanPSL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IMessageFactory

type IMessageFactory interface {
	GetMessage(buf []byte) (valid bool, ret protocol.IProtocol)
}

type Message

type Message struct {
	RouteType   Type   // route type 0-client,1-hall
	MessageType Type   // message type 0-close,1-proto
	Verion      uint32 // message short version
	SeqID       uint32 // unique id, zero while notify mode
	Time        int64  // unix time
	MsgID       uint16 // route for locating service
	Data        []byte // payload
	ProtoData   protoiface.MessageV1
}

Message represents a unmarshaled message or a message which to be marshaled

func NewMessage

func NewMessage(routeType Type, messageType Type,
	verion uint32, seqID uint32, msgID uint16,
	protoData protoreflect.ProtoMessage) (this *Message)

func NewMessageDirect added in v1.0.3

func NewMessageDirect(routeType Type, messageType Type,
	verion uint32, seqID uint32, msgID uint16,
	protoData []byte) (this *Message)

func NewMessageWith

func NewMessageWith(data []byte) (this *Message)

func (*Message) Decode

func (msg *Message) Decode(e interface{}) (valid bool)

func (*Message) Encode

func (msg *Message) Encode() (ret interface{})

func (*Message) GetSecurityType

func (msg *Message) GetSecurityType() int8

func (*Message) GetSerializeType

func (msg *Message) GetSerializeType() int8

func (*Message) String

func (msg *Message) String() string

type MessageFactory

type MessageFactory struct {
}

func NewMessageFactory

func NewMessageFactory() (this *MessageFactory)

func (*MessageFactory) GetMessage

func (factory *MessageFactory) GetMessage(buf []byte) (valid bool, ret protocol.IProtocol)

type Type

type Type byte

Jump to

Keyboard shortcuts

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