Documentation ¶
Overview ¶
Package couchbase provides an event sourcing implementation in couchbase for the CQRS and Event Sourcing framework
Current version: experimental
Index ¶
- Constants
- func IsNotFoundError(err error) bool
- type EventStreamRepository
- func (r *EventStreamRepository) AllIntegrationEventsEverPublished() ([]cqrs.VersionedEvent, error)
- func (r *EventStreamRepository) Get(id string, fromVersion int) ([]cqrs.VersionedEvent, error)
- func (r *EventStreamRepository) GetIntegrationEventsByCorrelationID(correlationID string) ([]cqrs.VersionedEvent, error)
- func (r *EventStreamRepository) GetSnapshot(id string) (cqrs.EventSourced, error)
- func (r *EventStreamRepository) Save(sourceID string, events []cqrs.VersionedEvent) error
- func (r *EventStreamRepository) SaveIntegrationEvent(event cqrs.VersionedEvent) error
- func (r *EventStreamRepository) SaveSnapshot(eventsourced cqrs.EventSourced) error
Constants ¶
const NotFound string = "Not found"
NotFound error string returned from couchbase when a key cannot be found
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundError ¶
IsNotFoundError checks if we get a key not found error from couchbase
Types ¶
type EventStreamRepository ¶
type EventStreamRepository struct {
// contains filtered or unexported fields
}
EventStreamRepository : a Couchbase Server event stream repository
func NewEventStreamRepository ¶
func NewEventStreamRepository(connectionString string, poolName string, bucketName string, prefix string) (*EventStreamRepository, error)
NewEventStreamRepository creates new Couchbase Server based event stream repository
func (*EventStreamRepository) AllIntegrationEventsEverPublished ¶
func (r *EventStreamRepository) AllIntegrationEventsEverPublished() ([]cqrs.VersionedEvent, error)
AllIntegrationEventsEverPublished retreives all events every persisted
func (*EventStreamRepository) Get ¶
func (r *EventStreamRepository) Get(id string, fromVersion int) ([]cqrs.VersionedEvent, error)
Get retrieves events assoicated with an event sourced object by ID
func (*EventStreamRepository) GetIntegrationEventsByCorrelationID ¶
func (r *EventStreamRepository) GetIntegrationEventsByCorrelationID(correlationID string) ([]cqrs.VersionedEvent, error)
GetIntegrationEventsByCorrelationID returns all integration events by correlation ID
func (*EventStreamRepository) GetSnapshot ¶ added in v1.0.0
func (r *EventStreamRepository) GetSnapshot(id string) (cqrs.EventSourced, error)
func (*EventStreamRepository) Save ¶
func (r *EventStreamRepository) Save(sourceID string, events []cqrs.VersionedEvent) error
Save persists an event sourced object into the repository
func (*EventStreamRepository) SaveIntegrationEvent ¶
func (r *EventStreamRepository) SaveIntegrationEvent(event cqrs.VersionedEvent) error
SaveIntegrationEvent persists a published integration event
func (*EventStreamRepository) SaveSnapshot ¶ added in v1.0.0
func (r *EventStreamRepository) SaveSnapshot(eventsourced cqrs.EventSourced) error