Documentation ¶
Index ¶
- func NewCloudEvent(eventID string, eventType string, data string) *common.CloudEvent
- func Publish(messageQueue common.MessageQueue, topic string, event *common.CloudEvent) error
- func Subscribe(messageQueue common.MessageQueue, group string, topic string, ...) error
- func UnSubscribe(messageQueue common.MessageQueue, group string, topic string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCloudEvent ¶ added in v1.4.0
func NewCloudEvent(eventID string, eventType string, data string) *common.CloudEvent
NewCloudEvent 创建CloudEventType 参数: - eventID: 事件ID,可以使用实体ID - eventType事件类型: 一般为领域.操作,如project.create - data: 事件的数据 返回值: - CloudEvent
func Publish ¶
func Publish(messageQueue common.MessageQueue, topic string, event *common.CloudEvent) error
Publish 发布消息 参数: - queue: 消息队列 - topic: 主题 - data: 消息数据 返回值: - 错误
func Subscribe ¶
func Subscribe(messageQueue common.MessageQueue, group string, topic string, handler common.MessageHandler) error
Subscribe 订阅 参数: - queue: 消息队列 - group: 消息组,不同的消息组的订阅者都能收到某一个主题的消息,同一个消息组的消费者只有一个能够消费消息 - topic: 主题 - handler: 消息处理函数 返回值: - 错误
func UnSubscribe ¶
func UnSubscribe(messageQueue common.MessageQueue, group string, topic string) error
UnSubscribe 取消订阅 参数: - queue: 消息队列 - group: 消息组,不同的消息组的订阅者都能收到某一个主题的消息,同一个消息组的消费者只有一个能够消费消息 - topic: 主题 返回值: - 错误
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.