Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultCloudEventType is the default event type for an Dapr published event DefaultCloudEventType = "com.dapr.event.sent" // CloudEventsSpecVersion is the specversion used by Dapr for the cloud events implementation CloudEventsSpecVersion = "0.3" //ContentType is the Cloud Events HTTP content type ContentType = "application/cloudevents+json" // DefaultCloudEventSource is the default event source DefaultCloudEventSource = "Dapr" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudEventsEnvelope ¶
type CloudEventsEnvelope struct {
ID string `json:"id"`
Source string `json:"source"`
Type string `json:"type"`
SpecVersion string `json:"specversion"`
DataContentType string `json:"datacontenttype"`
Data interface{} `json:"data"`
Subject string `json:"subject"`
Topic string `json:"topic"`
}
CloudEventsEnvelope describes the Dapr implementation of the Cloud Events spec Spec details: https://github.com/cloudevents/spec/blob/master/spec.md
func NewCloudEventsEnvelope ¶
func NewCloudEventsEnvelope(id, source, eventType, subject string, topic string, data []byte) *CloudEventsEnvelope
NewCloudEventsEnvelope returns CloudEventsEnvelope from data or a new one when data content was not
type NewMessage ¶
NewMessage is an event arriving from a message bus instance
type PubSub ¶
type PubSub interface {
Init(metadata Metadata) error
Publish(req *PublishRequest) error
Subscribe(req SubscribeRequest, handler func(msg *NewMessage) error) error
}
PubSub is the interface for message buses
type PublishRequest ¶
PublishRequest is the request to publish a message
type SubscribeRequest ¶
type SubscribeRequest struct {
Topic string `json:"topic"`
}
SubscribeRequest is the request to subscribe to a topic
Click to show internal directories.
Click to hide internal directories.