Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrConcurrency is produced when version conflicts arise from uncoordinated write occur ErrConcurrency = errors.New("Concurrency Exception") // ErrPayloadType is produced when an unsupported payload type is used ErrPayloadType = errors.New("Only payloads of type []byte are allowed") // ErrEventInsert is produced when there's an error inserting into the events table ErrEventInsert = errors.New("Error inserting record into events table") // ErrPubInsert is oridyced when there's an error inserting into the publish table ErrPubInsert = errors.New("Error inserting record into pub table") )
Functions ¶
This section is empty.
Types ¶
type PGEventStore ¶
type PGEventStore struct {
// contains filtered or unexported fields
}
PGEventStore is the type encapsulating event store functionality implemented using Postgres as the durable event store.
func NewPGEventStore ¶
func NewPGEventStore(db *sql.DB, enableEventPublishing bool) (*PGEventStore, error)
NewPGEventStore instantiates an event store with the provided database interface instance. Passing true via enableEventPublishing writes events to the publish table when transactions commit.
func (*PGEventStore) GetMaxVersionForAggregate ¶
func (es *PGEventStore) GetMaxVersionForAggregate(aggID string) (*int, error)
GetMaxVersionForAggregate returns the greatest version number for the given aggregate.
func (*PGEventStore) RepublishAllEvents ¶
func (es *PGEventStore) RepublishAllEvents() error
RepublishAllEvents writes all the events in the event store to the publish table.
func (*PGEventStore) RetrieveEvents ¶
func (es *PGEventStore) RetrieveEvents(aggID string) ([]goes.Event, error)
RetrieveEvents returns the events associated with the given aggregate.
func (*PGEventStore) StoreEvents ¶
func (es *PGEventStore) StoreEvents(agg *goes.Aggregate) error
StoreEvents stores the uncommitted events assocaited with the given aggregate.
Click to show internal directories.
Click to hide internal directories.