Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo uses a mongodb for storage
func (*Mongo) CheckReady ¶
CheckReady checks to see if the service can connect
func (*Mongo) GetEvents ¶
func (m *Mongo) GetEvents(coll, uuid string) ([]*StoredEvent, error)
GetEvents gets all events for a particular uuid in a particular collection
func (*Mongo) GetVersion ¶
GetVersion gets the most recently inserted event version or 0 on not found/error
type ReadRepository ¶ added in v0.4.0
type ReadRepository struct {
// contains filtered or unexported fields
}
ReadRepository is a generic repository for reads
func NewReadRepository ¶ added in v0.4.0
func NewReadRepository(n string, et map[string]func() ddd.Event, r func([]ddd.Event) ddd.Aggregate, s Storage) *ReadRepository
NewReadRepository gets a new generic repository for reads
type Storage ¶
type Storage interface { CheckReady() error IDs(collection string) ([]string, error) GetEvents(collection, uuid string) ([]*StoredEvent, error) GetVersion(collection, uuid string) int StoreEvent(collection, uuid, eventType, eventData string, version int) error }
Storage is the basic interface for storing of event streams
type StoredEvent ¶
StoredEvent represents an event in storage which includes its uuid, version, type, and event (as json)
type WriteRepository ¶ added in v0.4.0
type WriteRepository struct {
// contains filtered or unexported fields
}
WriteRepository is a generic repository for reads/writes
func NewWriteRepository ¶ added in v0.4.0
func NewWriteRepository(n string, s Storage) *WriteRepository
NewWriteRepository gets a new generic repository for reads/writes