Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCounters ¶
WithCounters allows clients to configure optional counters to monitor outbox delivery outcome.
func WithLogger ¶
WithLogger allows clients to configure an optional logger.
Types ¶
type Goutbox ¶
type Goutbox struct {
// contains filtered or unexported fields
}
Goutbox implements the Goutbox module.
func Singleton ¶
func Singleton(s Settings, r repository.Repository, e emitter.Emitter, options ...opt) *Goutbox
Singleton creates a unique instance of Goutbox using the provided settings and options and the provided Repository and an Emitter implementations.
func (*Goutbox) Publish ¶
Publish publishes a domain event reliably within a business transaction, utilizing the polling publisher variant of the Transactional Outbox pattern. An opened database transaction is expected to be in the provided context. Take a look to the different repository implementations to see the expected transaction type in each case.
type Outbox ¶
type Outbox struct { AggregateType string // the aggregate type (e.g. "Restaurant") AggregateId string // the aggregate identifier EventType string // the event type (e.g "RestaurantCreated") Payload []byte // event payload }
Outbox contains high level information about a domain event and should be provided by the clients.
type Settings ¶
type Settings struct { EnableDispatcher bool // enables the dispatcher using the polling publisher pattern MaxDispatchers int // in HA environments, maximum allowed number of dispatchers working concurrently PollingInterval time.Duration // interval between database pollings by the dispatchers MaxEventsPerInterval int // maximum number of events to be processed by a dispatcher in each iteration (-1 = unlimited) MaxEventsPerBatch int // maximum number of events per batch }
Settings holds the general Goutbox module configuration.