Documentation ¶
Index ¶
- Constants
- func InitRocketMQ(newObservers ...MQMessageObserver)
- func ShutdownNotifyConsumer()
- type MQMessageObserver
- type MQNotifyMessage
- type RocketmqKeeper
- func (keeper *RocketmqKeeper) AddObservers(newObservers ...MQMessageObserver) error
- func (keeper *RocketmqKeeper) NewMessage(topic string, messageType string, payload interface{}) (*MQNotifyMessage, error)
- func (keeper *RocketmqKeeper) RemoveObservers(observerNames ...string) error
- func (keeper *RocketmqKeeper) SendMessage(message *MQNotifyMessage) error
Constants ¶
View Source
const ( ENABLE = "enable" DISABLE = "disable" MESSAGE_TYPE_TEST = "notify.test" NOTIFY_ONLINE = "device.online" NOTIFY_OFFLINE = "device.offline" NOTIFY_NORMAL = "message.normal" )
View Source
const (
ROCKETMQ_KEEPER = "zero.rocketmq.keeper"
)
Variables ¶
This section is empty.
Functions ¶
func InitRocketMQ ¶
func InitRocketMQ(newObservers ...MQMessageObserver)
func ShutdownNotifyConsumer ¶
func ShutdownNotifyConsumer()
Types ¶
type MQMessageObserver ¶
type MQMessageObserver interface { Name() string OnMessage(*MQNotifyMessage) error }
type MQNotifyMessage ¶
type MQNotifyMessage struct { MessageId string `json:"messageId,omitempty"` Topic string `json:"topic,omitempty"` CreateTime structs.Time `json:"createTime,omitempty"` MessageType string `json:"messageType,omitempty"` Payload interface{} `json:"payload,omitempty"` }
func (*MQNotifyMessage) JSONString ¶
func (notify *MQNotifyMessage) JSONString() ([]byte, error)
func (*MQNotifyMessage) NewMessage ¶
func (notify *MQNotifyMessage) NewMessage(topic string, messageType string, payload interface{}) error
func (*MQNotifyMessage) WithJSONString ¶
func (notify *MQNotifyMessage) WithJSONString(jsonbytes []byte) error
type RocketmqKeeper ¶
type RocketmqKeeper struct{}
func (*RocketmqKeeper) AddObservers ¶
func (keeper *RocketmqKeeper) AddObservers(newObservers ...MQMessageObserver) error
func (*RocketmqKeeper) NewMessage ¶
func (keeper *RocketmqKeeper) NewMessage(topic string, messageType string, payload interface{}) (*MQNotifyMessage, error)
func (*RocketmqKeeper) RemoveObservers ¶
func (keeper *RocketmqKeeper) RemoveObservers(observerNames ...string) error
func (*RocketmqKeeper) SendMessage ¶
func (keeper *RocketmqKeeper) SendMessage(message *MQNotifyMessage) error
Click to show internal directories.
Click to hide internal directories.