Documentation ¶
Index ¶
Constants ¶
const ( AggregateIDMessageAttributeKey = "aggID" AggregateNameMessageAttributeKey = "aggName" AggregateVersionMessageAttributeKey = "aggVer" EventIDMessageAttributeKey = "id" EventNameMessageAttributeKey = "name" EventTimeMessageAttributeKey = "time" EventTimeFormat = time.RFC3339 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶
func NewPublisher(ctx context.Context, client *pubsub.Client, encoding codec.Encoding, log logger.Logger, config PublisherConfig) *Publisher
NewPublisher creates a new Publisher that publishes events to a PubSub topic The topic must be created before using this gateway Messages are sent in order, so the OrderingKey is set to the Aggregate ID
To authenticate with PubSub, the GOOGLE_APPLICATION_CREDENTIALS environment variable must be set See https://cloud.google.com/docs/authentication/getting-started for more information
type PublisherAdapter ¶
type PublisherAdapter struct {
// contains filtered or unexported fields
}
PublisherAdapter is an adapter that allows to use a pubsub.Publisher as an eventbus.Publisher
func NewPublisherAdapter ¶
func NewPublisherAdapter(pubSubPublisher *Publisher) *PublisherAdapter
type PublisherConfig ¶
type PullAdapter ¶
type PullAdapter struct {
// contains filtered or unexported fields
}
PullAdapter pulls events from a PubSub topic and publishes them to a local event bus
func NewPullAdapter ¶
func NewPullAdapter(client *pubsub.Client, publisher eventbus.Publisher, encoder codec.Encoding, log logger.Logger, config PullAdapterConfig) *PullAdapter
NewPullAdapter creates a new PullAdapter that pulls events from a PubSub topic and publishes them to another publisher
The provided enconder should have all the event types registered before processing events.
To authenticate with PubSub, the GOOGLE_APPLICATION_CREDENTIALS environment variable must be set See https://cloud.google.com/docs/authentication/getting-started for more information