Documentation
¶
Index ¶
- type Dispatcher
- type Event
- type EventStore
- func (eventstore *EventStore) Broadcast() error
- func (eventstore *EventStore) BroadcastWithRabbitMQ(queueName string) error
- func (eventstore *EventStore) CloseRabbitMQ()
- func (eventstore *EventStore) Commit() error
- func (eventstore *EventStore) InitRabbitMQ() error
- func (eventstore *EventStore) Publish(event *Event)
- func (eventstore *EventStore) PublishWithRabbitMQ(event *Event)
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatcher ¶
Dispatcher maps event projections to their respective handler functions
type EventStore ¶
type EventStore struct {
Mutex sync.Mutex
Dispatcher *Dispatcher
Events *sync.Pool
RabbitMQ *amqp.Connection
Channel *amqp.Channel
}
EventStore handles publishing and dispatching events
func NewEventStore ¶
func NewEventStore(dispatcher *Dispatcher) *EventStore
NewEventStore initializes an EventStore with a dispatcher and an event pool
func (*EventStore) Broadcast ¶
func (eventstore *EventStore) Broadcast() error
Broadcast locks the store and processes each event in the pool
func (*EventStore) BroadcastWithRabbitMQ ¶ added in v0.1.14
func (eventstore *EventStore) BroadcastWithRabbitMQ(queueName string) error
func (*EventStore) CloseRabbitMQ ¶ added in v0.1.13
func (eventstore *EventStore) CloseRabbitMQ()
func (*EventStore) Commit ¶ added in v0.1.11
func (eventstore *EventStore) Commit() error
Commit retrieves and processes an event from the pool
func (*EventStore) InitRabbitMQ ¶ added in v0.1.20
func (eventstore *EventStore) InitRabbitMQ() error
func (*EventStore) Publish ¶
func (eventstore *EventStore) Publish(event *Event)
Publish adds an event to the event pool
func (*EventStore) PublishWithRabbitMQ ¶ added in v0.1.20
func (eventstore *EventStore) PublishWithRabbitMQ(event *Event)
Click to show internal directories.
Click to hide internal directories.