couchbase

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package couchbase provides an event sourcing implementation in couchbase for the CQRS and Event Sourcing framework

Current version: experimental

Index

Constants

View Source
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

func IsNotFoundError(err error) bool

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL