mongodb

package
v0.0.0-...-fc38f95 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDbEventStore

type MongoDbEventStore struct {
	// contains filtered or unexported fields
}

MongoDbEventStore The mongodb event store

func NewEventStore

func NewEventStore(conn *mgo.Session, r goengine.TypeRegistry) *MongoDbEventStore

NewEventStore creates new MongoDB based event store

func (*MongoDbEventStore) Append

func (s *MongoDbEventStore) Append(events *goengine.EventStream) error

Append adds an event to the event store

func (*MongoDbEventStore) CountEventsFor

func (s *MongoDbEventStore) CountEventsFor(streamName goengine.StreamName, id string) (int, error)

CountEventsFor counts events for an id on the specified stream

func (*MongoDbEventStore) FromVersion

func (s *MongoDbEventStore) FromVersion(streamName goengine.StreamName, id string, version int) (*goengine.EventStream, error)

FromVersion gets events for an id and version on the specified stream

func (*MongoDbEventStore) GetEventsFor

func (s *MongoDbEventStore) GetEventsFor(streamName goengine.StreamName, id string) (*goengine.EventStream, error)

GetEventsFor gets events for an id on the specified stream

type MongoEvent

type MongoEvent struct {
	ID         string    `bson:"aggregate_id,omitempty"`
	Version    int       `bson:"version"`
	Type       string    `bson:"type"`
	Payload    string    `bson:"payload"`
	RecordedOn time.Time `bson:"recorded_on"`
}

MongoEvent represents an event on mongodb

Jump to

Keyboard shortcuts

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