Documentation ¶
Overview ¶
Package msg is a generated protocol buffer package.
It is generated from these files:
msg.proto
It has these top-level messages:
Message MessageList
Index ¶
- Variables
- func BatchMarshal(msgs *MessageList, w io.Writer) error
- func Marshal(msg *Message, w io.Writer) error
- type Message
- func NewAckMsg() *Message
- func NewErrorMsg() *Message
- func NewHeartbeatMsg() *Message
- func NewPublishMsg(topic string, body []byte) *Message
- func NewSubscribeMsg(topic string, filter string, cnt string) *Message
- func NewUnSubscribeMsg(topic string, filter string) *Message
- func Unmarshal(r io.Reader) (*Message, error)
- func (*Message) Descriptor() ([]byte, []int)
- func (m *Message) GetBody() []byte
- func (m *Message) GetCount() int64
- func (m *Message) GetFilter() string
- func (m *Message) GetMsgId() uint64
- func (m *Message) GetNeedAck() bool
- func (m *Message) GetPersist() bool
- func (m *Message) GetPubType() PublishType
- func (m *Message) GetTimestamp() int64
- func (m *Message) GetTopic() string
- func (m *Message) GetType() MessageType
- func (m *Message) Marshal() (data []byte, err error)
- func (m *Message) MarshalTo(data []byte) (int, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (m *Message) Unmarshal(data []byte) error
- type MessageList
- func (*MessageList) Descriptor() ([]byte, []int)
- func (m *MessageList) GetMsgs() []*Message
- func (m *MessageList) Marshal() (data []byte, err error)
- func (m *MessageList) MarshalTo(data []byte) (int, error)
- func (*MessageList) ProtoMessage()
- func (m *MessageList) Reset()
- func (m *MessageList) Size() (n int)
- func (m *MessageList) String() string
- func (m *MessageList) Unmarshal(data []byte) error
- type MessageType
- type PublishType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthMsg = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMsg = fmt.Errorf("proto: integer overflow") )
View Source
var MessageType_name = map[int32]string{
0: "Subscribe",
1: "Publish",
2: "UnSubscribe",
3: "Ack",
4: "Heartbeat",
5: "Error",
6: "Close",
}
View Source
var MessageType_value = map[string]int32{
"Subscribe": 0,
"Publish": 1,
"UnSubscribe": 2,
"Ack": 3,
"Heartbeat": 4,
"Error": 5,
"Close": 6,
}
View Source
var PublishType_name = map[int32]string{
0: "DirectType",
1: "FanoutType",
}
View Source
var PublishType_value = map[string]int32{
"DirectType": 0,
"FanoutType": 1,
}
Functions ¶
Types ¶
type Message ¶
type Message struct { MsgId uint64 `protobuf:"varint,1,opt,name=msg_id,json=msgId" json:"msg_id"` Type MessageType `protobuf:"varint,2,opt,name=type,enum=MessageType" json:"type"` Topic string `protobuf:"bytes,3,opt,name=topic" json:"topic"` Filter string `protobuf:"bytes,4,opt,name=filter" json:"filter"` Body []byte `protobuf:"bytes,5,opt,name=body" json:"body,omitempty"` Timestamp int64 `protobuf:"varint,6,opt,name=timestamp" json:"timestamp"` PubType PublishType `protobuf:"varint,7,opt,name=pubType,enum=PublishType" json:"pubType"` Count int64 `protobuf:"varint,8,opt,name=count" json:"count"` Persist bool `protobuf:"varint,9,opt,name=persist" json:"persist"` NeedAck bool `protobuf:"varint,10,opt,name=need_ack,json=needAck" json:"need_ack"` }
func NewPublishMsg ¶
NewPublishMsg creates a publish msg
func NewSubscribeMsg ¶
NewSubscribeMsg creates a subscribe msg
func NewUnSubscribeMsg ¶
NewUnSubscribeMsg creates a unSubscribe msg
func (*Message) Descriptor ¶
func (*Message) GetNeedAck ¶
func (*Message) GetPersist ¶
func (*Message) GetPubType ¶
func (m *Message) GetPubType() PublishType
func (*Message) GetTimestamp ¶
func (*Message) GetType ¶
func (m *Message) GetType() MessageType
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
type MessageList ¶
type MessageList struct {
Msgs []*Message `protobuf:"bytes,1,rep,name=msgs" json:"msgs,omitempty"`
}
func BatchUnmarshal ¶
func BatchUnmarshal(r io.Reader) (*MessageList, error)
BatchUnmarshal the msgs
func (*MessageList) Descriptor ¶
func (*MessageList) Descriptor() ([]byte, []int)
func (*MessageList) GetMsgs ¶
func (m *MessageList) GetMsgs() []*Message
func (*MessageList) Marshal ¶
func (m *MessageList) Marshal() (data []byte, err error)
func (*MessageList) ProtoMessage ¶
func (*MessageList) ProtoMessage()
func (*MessageList) Reset ¶
func (m *MessageList) Reset()
func (*MessageList) Size ¶
func (m *MessageList) Size() (n int)
func (*MessageList) String ¶
func (m *MessageList) String() string
func (*MessageList) Unmarshal ¶
func (m *MessageList) Unmarshal(data []byte) error
type MessageType ¶
type MessageType int32
const ( MessageType_Subscribe MessageType = 0 MessageType_Publish MessageType = 1 MessageType_UnSubscribe MessageType = 2 MessageType_Ack MessageType = 3 MessageType_Heartbeat MessageType = 4 MessageType_Error MessageType = 5 MessageType_Close MessageType = 6 )
func (MessageType) Enum ¶
func (x MessageType) Enum() *MessageType
func (MessageType) EnumDescriptor ¶
func (MessageType) EnumDescriptor() ([]byte, []int)
func (MessageType) String ¶
func (x MessageType) String() string
func (*MessageType) UnmarshalJSON ¶
func (x *MessageType) UnmarshalJSON(data []byte) error
type PublishType ¶
type PublishType int32
const ( PublishType_DirectType PublishType = 0 PublishType_FanoutType PublishType = 1 )
func (PublishType) Enum ¶
func (x PublishType) Enum() *PublishType
func (PublishType) EnumDescriptor ¶
func (PublishType) EnumDescriptor() ([]byte, []int)
func (PublishType) String ¶
func (x PublishType) String() string
func (*PublishType) UnmarshalJSON ¶
func (x *PublishType) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.