Documentation ¶
Index ¶
- Variables
- func Clear()
- func CreateMessageByID(msgId uint32) proto.Message
- func CreateMessageByName(fullName string) proto.Message
- func CreatePairingAck(reqName string) proto.Message
- func GetMessageFullName(msgId uint32) string
- func GetMessageId(fullName string) uint32
- func GetMessageIdOf(msg proto.Message) uint32
- func GetMessageShortName(msgId uint32) string
- func GetMessageType(msgId uint32) reflect.Type
- func GetPairingAckName(reqName string) string
- func GetPairingAckNameOf(msgId uint32) string
- func HasValidSuffix(name string) bool
- func IsAckMessage(name string) bool
- func IsReqMessage(name string) bool
- func Marshal(m proto.Message) ([]byte, error)
- func MarshalProtoJSON(msg proto.Message) ([]byte, error)
- func NameHash(name string) uint32
- func Register(fullname string) error
- func RegisterAllMessages()
- func Unmarshal(b []byte, m Message) error
- func UnmarshalProtoJSON(b []byte, m proto.Message) error
- type Message
- type VTProtoMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Merge = proto.Merge Clone = proto.Clone )
Functions ¶
func CreateMessageByID ¶
CreateMessageByID 根据消息ID创建消息(使用反射)
func CreateMessageByName ¶
CreateMessageByName 根据消息名称创建消息(使用反射)
func CreatePairingAck ¶
func GetMessageFullName ¶
GetMessageFullName 根据消息ID获取消息名称
func GetMessageShortName ¶
func GetMessageType ¶
func GetPairingAckName ¶
GetPairingAckName 根据Req消息名称,返回其对应的Ack消息名称
func GetPairingAckNameOf ¶
func IsAckMessage ¶
func IsReqMessage ¶
func MarshalProtoJSON ¶
MarshalProtoJSON 序列化proto消息为json格式
func RegisterAllMessages ¶
func RegisterAllMessages()
RegisterAllMessages 自动注册所有protobuf消息 protobuf使用init()注册(RegisterType),则此API需要在import后调用
Types ¶
Click to show internal directories.
Click to hide internal directories.