mongodb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotClearDB = errors.New("could not clear database")

ErrCouldNotClearDB is when the database could not be cleared.

View Source
var ErrCouldNotDialDB = errors.New("could not dial database")

ErrCouldNotDialDB is when the database could not be dialed.

View Source
var ErrCouldNotLoadSnapshot = errors.New("could not load snapshot")

ErrCouldNotLoadSnapshot is when an aggregate could not be loaded.

View Source
var ErrCouldNotMarshalSnapshot = errors.New("could not marshal snapshot")

ErrCouldNotMarshalSnapshot is when an event could not be marshaled into BSON.

View Source
var ErrCouldNotSaveSnapshot = errors.New("could not save snapshot")

ErrCouldNotSaveSnapshot is when an aggregate could not be saved.

View Source
var ErrCouldNotUnmarshalSnapshot = errors.New("could not unmarshal snapshot")

ErrCouldNotUnmarshalSnapshot is when an event could not be unmarshaled into a concrete type.

View Source
var ErrNoDBSession = errors.New("no database session")

ErrNoDBSession is when no database session is set.

Functions

This section is empty.

Types

type Options

type Options struct {
	SSL            bool
	DBHost         string
	DBName         string
	DBUser         string
	DBPassword     string
	SingleSnapshot bool
}

type SnapshotStore

type SnapshotStore struct {
	SingleSnapshot bool
	// contains filtered or unexported fields
}

func NewSnapshotStore

func NewSnapshotStore(options Options) (*SnapshotStore, error)

NewSnapshotStore creates a new EventStore.

func (*SnapshotStore) Clear

func (s *SnapshotStore) Clear(ctx context.Context) error

func (*SnapshotStore) Close

func (s *SnapshotStore) Close()

func (*SnapshotStore) Load

func (s *SnapshotStore) Load(ctx context.Context, aggregateType eh.AggregateType, id string, version int) (eh.Aggregate, error)

func (*SnapshotStore) Save

func (s *SnapshotStore) Save(ctx context.Context, aggregate eh.Aggregate) error

Jump to

Keyboard shortcuts

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