Documentation ¶
Index ¶
- type Entity
- type EventStore
- func (es *EventStore) AddEvent(e *registry.Event, expectedSeq uint64) (uint64, error)
- func (es *EventStore) NewEvent(name string) *registry.Event
- func (es *EventStore) Project(model Entity) (uint64, error)
- func (es *EventStore) ProjectAll(models []Entity) (map[string]uint64, map[string]error)
- func (es *EventStore) Start() error
- func (es *EventStore) Stop() error
- type MockEntity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
func NewEventStore ¶
func NewEventStore(name string, be backend.Backend, er *registry.EventRegistry, replicationFactor int) *EventStore
func (*EventStore) AddEvent ¶
AddEvent synchronously adds a new event to the store and returns the sequence number
func (*EventStore) NewEvent ¶
func (es *EventStore) NewEvent(name string) *registry.Event
NewEvent creates a new event with the given name
func (*EventStore) Project ¶
func (es *EventStore) Project(model Entity) (uint64, error)
Project applies all events for a given entity to the model and returns the last sequence number applied and the error if any
func (*EventStore) ProjectAll ¶
ProjectAll applies all events for a given list of entities to the models and returns a map of the last sequence number applied and a map of errors if any
func (*EventStore) Start ¶
func (es *EventStore) Start() error
Start connects to the backend and sets up the store
func (*EventStore) Stop ¶
func (es *EventStore) Stop() error
Stop closes the connection to the backend
type MockEntity ¶
func (*MockEntity) Id ¶
func (m *MockEntity) Id() string
Click to show internal directories.
Click to hide internal directories.