msg

package
v0.0.0-...-60b9055 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 7 Imported by: 0

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

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

func BatchMarshal

func BatchMarshal(msgs *MessageList, w io.Writer) error

BatchMarshal the msgs

func Marshal

func Marshal(msg *Message, w io.Writer) error

Marshal the msg

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 NewAckMsg

func NewAckMsg() *Message

NewAckMsg creates a Ack msg

func NewErrorMsg

func NewErrorMsg() *Message

NewErrorMsg creates a error msg

func NewHeartbeatMsg

func NewHeartbeatMsg() *Message

NewHeartbeatMsg creates a heartbeat msg

func NewPublishMsg

func NewPublishMsg(topic string, body []byte) *Message

NewPublishMsg creates a publish msg

func NewSubscribeMsg

func NewSubscribeMsg(topic string, filter string, cnt string) *Message

NewSubscribeMsg creates a subscribe msg

func NewUnSubscribeMsg

func NewUnSubscribeMsg(topic string, filter string) *Message

NewUnSubscribeMsg creates a unSubscribe msg

func Unmarshal

func Unmarshal(r io.Reader) (*Message, error)

Unmarshal the msg

func (*Message) Descriptor

func (*Message) Descriptor() ([]byte, []int)

func (*Message) GetBody

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

func (*Message) GetCount

func (m *Message) GetCount() int64

func (*Message) GetFilter

func (m *Message) GetFilter() string

func (*Message) GetMsgId

func (m *Message) GetMsgId() uint64

func (*Message) GetNeedAck

func (m *Message) GetNeedAck() bool

func (*Message) GetPersist

func (m *Message) GetPersist() bool

func (*Message) GetPubType

func (m *Message) GetPubType() PublishType

func (*Message) GetTimestamp

func (m *Message) GetTimestamp() int64

func (*Message) GetTopic

func (m *Message) GetTopic() string

func (*Message) GetType

func (m *Message) GetType() MessageType

func (*Message) Marshal

func (m *Message) Marshal() (data []byte, err error)

func (*Message) MarshalTo

func (m *Message) MarshalTo(data []byte) (int, error)

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) Size

func (m *Message) Size() (n int)

func (*Message) String

func (m *Message) String() string

func (*Message) Unmarshal

func (m *Message) Unmarshal(data []byte) error

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 PackageMsgs

func PackageMsgs(m ...*Message) *MessageList

PackageMsgs 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) MarshalTo

func (m *MessageList) MarshalTo(data []byte) (int, 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

Jump to

Keyboard shortcuts

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