Documentation
¶
Index ¶
- type BoltDBStore
- func (s *BoltDBStore) Close() error
- func (s *BoltDBStore) Load(ctx context.Context, aggregateID string) (*historyv1.History, error)
- func (s *BoltDBStore) LoadTail(ctx context.Context, aggregateID string, n int) (*historyv1.History, error)
- func (s *BoltDBStore) Save(ctx context.Context, aggregateID string, records ...*recordv1.Record) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoltDBStore ¶
type BoltDBStore struct {
// contains filtered or unexported fields
}
BoltDBStore is a sharded BoltDB-backed implementation of the Store and AggregateStore interfaces. Data is spread across multiple BoltDB files keyed by aggregate ID, with an index DB tracking shard assignments.
func New ¶
func New(basePath string, pkg string, opts ...Option) (*BoltDBStore, error)
New creates a new BoltDBStore. basePath is the root directory and pkg is the subdirectory name (e.g. the aggregate package). The directory basePath/pkg/ is created if it does not exist.
func (*BoltDBStore) Close ¶
func (s *BoltDBStore) Close() error
Close closes the index DB and all open shard DBs.
type Option ¶
type Option func(*BoltDBStore)
Option configures a BoltDBStore.
func WithMaxPerShard ¶
WithMaxPerShard sets the maximum number of aggregate IDs per shard file. Default is 10,000.
Click to show internal directories.
Click to hide internal directories.