GxMessage

package
v0.0.0-...-6664dcb Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package test is a generated protocol buffer package.

It is generated from these files:

test.proto

It has these top-level messages:

MessageNot

Index

Constants

View Source
const (
	MessageMaskDisconn = 0 //是否断开连接
	MessageMaskNotify  = 1 //是否通知
)
View Source
const (
	MessageIdBit    = 0  //消息来源或者目的id
	MessageUnlenBit = 4  //未压缩前消息体长度,可为0,和len相等表示没有压缩
	MessageLenBit   = 6  //消息体长度,可为0
	MessageCmdBit   = 8  //消息命令字
	MessageSeqBit   = 10 //消息序号
	MessageRetBit   = 12 //消息返回值,消息返回时使用
	MessageMaskBit  = 14 //一些标志

	MessageHeaderLen = 16 //消息长度
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GxMessage

type GxMessage struct {
	Header []byte
	Data   []byte
}

func NewGxMessage

func NewGxMessage() *GxMessage

func (*GxMessage) Copy

func (msg *GxMessage) Copy() *GxMessage

func (*GxMessage) GetCmd

func (msg *GxMessage) GetCmd() uint16

func (*GxMessage) GetId

func (msg *GxMessage) GetId() uint32

func (*GxMessage) GetLen

func (msg *GxMessage) GetLen() uint16

func (*GxMessage) GetMask

func (msg *GxMessage) GetMask(mask uint16) bool

func (*GxMessage) GetRet

func (msg *GxMessage) GetRet() uint16

func (*GxMessage) GetSeq

func (msg *GxMessage) GetSeq() uint16

func (*GxMessage) GetUnlen

func (msg *GxMessage) GetUnlen() uint16

func (*GxMessage) InitData

func (msg *GxMessage) InitData()

根据消息长度初始化消息体内存

func (*GxMessage) Package

func (msg *GxMessage) Package(buf []byte) error

打包原生字符串

func (*GxMessage) PackagePbmsg

func (msg *GxMessage) PackagePbmsg(pb proto.Message) error

打包protobuf消息

func (*GxMessage) SetCmd

func (msg *GxMessage) SetCmd(cmd uint16)

func (*GxMessage) SetId

func (msg *GxMessage) SetId(id uint32)

func (*GxMessage) SetLen

func (msg *GxMessage) SetLen(len uint16)

func (*GxMessage) SetMask

func (msg *GxMessage) SetMask(mask uint16, b bool)

func (*GxMessage) SetRet

func (msg *GxMessage) SetRet(ret uint16)

func (*GxMessage) SetSeq

func (msg *GxMessage) SetSeq(seq uint16)

func (*GxMessage) SetUnlen

func (msg *GxMessage) SetUnlen(len uint16)

func (*GxMessage) String

func (msg *GxMessage) String() string

func (*GxMessage) Unpackage

func (msg *GxMessage) Unpackage() ([]byte, error)

解包原生字符串

func (*GxMessage) UnpackagePbmsg

func (msg *GxMessage) UnpackagePbmsg(pb proto.Message) error

解包protobuf消息

type MessageNot

type MessageNot struct {
	Id               *uint32 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
	Text             *string `protobuf:"bytes,2,opt,name=text" json:"text,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*MessageNot) GetId

func (m *MessageNot) GetId() uint32

func (*MessageNot) GetText

func (m *MessageNot) GetText() string

func (*MessageNot) ProtoMessage

func (*MessageNot) ProtoMessage()

func (*MessageNot) Reset

func (m *MessageNot) Reset()

func (*MessageNot) String

func (m *MessageNot) String() string

Jump to

Keyboard shortcuts

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