Documentation ¶
Overview ¶
Package eventstore handles the low level badger interactions.
Index ¶
- type AggregateStats
- type BadgerEventStore
- func (b *BadgerEventStore) Append(aggregate string, entity string, content interface{}) (*Tail, error)
- func (b *BadgerEventStore) Close() error
- func (b *BadgerEventStore) Read(aggregate string, entity string, factId string, maxCount int) (*RecordList, error)
- func (b *BadgerEventStore) Register(t interface{})
- func (b *BadgerEventStore) Scan(aggregate string) (*EntityList, error)
- func (b *BadgerEventStore) Tail(aggregate string, entity string) (*Tail, error)
- type EntityList
- type EventStore
- type Fact
- type IdGenerator
- type RecordList
- type Tail
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateStats ¶
type AggregateStats struct { LastId ulid.ULID Total uint }
type BadgerEventStore ¶
type BadgerEventStore struct { RootDir string MemoryOnly bool EncryptionKey []byte EncryptionRotationDuration time.Duration // contains filtered or unexported fields }
func (*BadgerEventStore) Append ¶
func (b *BadgerEventStore) Append(aggregate string, entity string, content interface{}) (*Tail, error)
func (*BadgerEventStore) Close ¶
func (b *BadgerEventStore) Close() error
func (*BadgerEventStore) Read ¶
func (b *BadgerEventStore) Read(aggregate string, entity string, factId string, maxCount int) (*RecordList, error)
func (*BadgerEventStore) Register ¶
func (b *BadgerEventStore) Register(t interface{})
func (*BadgerEventStore) Scan ¶
func (b *BadgerEventStore) Scan(aggregate string) (*EntityList, error)
type EntityList ¶
type EventStore ¶
type EventStore interface { // Register a type for (de)serialization, needed to store and reconstitute objects Register(t interface{}) // Append append an event to the event store for the fact Append(aggregate string, entity string, content interface{}) (*Tail, error) // Tail gets the last event id Tail(aggregate string, entity string) (*Tail, error) // Read the events for an aggregate from the identified event id Read(aggregate string, entity string, originEventId string, maxCount int) (*RecordList, error) // Scan will list all keys in the aggregate (excluding individual events) Scan(aggregate string) (*EntityList, error) // Close the event store Close() error }
EventStore provides an interface to store events for a topic, and retrieve them later.
func EncryptedFileStore ¶
func EncryptedFileStore(path string, key []byte, rotationDur time.Duration) EventStore
func FileStore ¶
func FileStore(path string) EventStore
func MemoryStore ¶
func MemoryStore() EventStore
type IdGenerator ¶
func NewIdGenerator ¶
func NewIdGenerator() IdGenerator
type RecordList ¶
Click to show internal directories.
Click to hide internal directories.