Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudEvent ¶ added in v1.4.0
type CloudEvent struct { SpecVersion string `json:"specversion"` ID string `json:"id"` Type string `json:"type"` Source string `json:"source"` DataContentType string `json:"datacontenttype"` Time string `json:"time"` Data string `json:"data"` }
func NewCloudEvent ¶ added in v1.4.0
func NewCloudEvent(eventID string, eventType string, data string) *CloudEvent
func UnmarshalCloudEvent ¶ added in v1.4.0
func UnmarshalCloudEvent(data []byte) (*CloudEvent, error)
func (*CloudEvent) Marshal ¶ added in v1.4.0
func (event *CloudEvent) Marshal() ([]byte, error)
type MessageHandler ¶
type MessageHandler func(queue MessageQueue, topic string, event *CloudEvent)
MessageHandler 消息处理函数 参数: - queue: 消息队列 - topic: 主题 - data: 消息数据 返回值: 无
type MessageQueue ¶
type MessageQueue interface { Subscribe(group string, topic string, handler MessageHandler) error UnSubscribe(group string, topic string) error Publish(topic string, event *CloudEvent) error }
MessageQueue 消息队列接口
Click to show internal directories.
Click to hide internal directories.