Documentation
¶
Overview ¶
Package eventstore is eventing's one durable store (ADR-0201): one Badger instance holding the Sensor's dead letters under dl/<ns>/<ulid> (ADR-0118) and the BlobWatcher's seen lists under seen/ (ADR-0157), each tenant iterating only its own prefix. With a directory both tenants survive a restart; in memory both are lost, and the seen lists live in a MemWatermark. The store is one ADR-0202 snapshot unit: Snapshot reads both tenants at once.
Index ¶
- func MigrateSeenLists(ctx context.Context, kv kvstore.KV, s *Store) (moved int, err error)
- type Config
- type Store
- func (s *Store) Close() error
- func (s *Store) DeadLetters() deadletter.Store
- func (s *Store) Load(ctx context.Context, next func() (snapshot.Record, error)) error
- func (s *Store) SeenLists() eventing.Watermark
- func (s *Store) Snapshot(ctx context.Context, emit func(snapshot.Record) error) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateSeenLists ¶
MigrateSeenLists moves the seen lists the KV holds under legacyPrefix into s (ADR-0201 Decision 6). A record with no bucket (an ADR-0119 Cursor) is skipped, and one s already holds keeps the newer list s has. Every key under the prefix is deleted only after every copy committed, so an error leaves the KV keys and the next start resumes.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the event store; DeadLetters and SeenLists are its two tenants.
func Open ¶
Open opens the event store with the dead-letter profile, and runs the value-log GC on disk.
func (*Store) Close ¶
Close stops the GC loop, then closes the instance; the BlobWatcher and the Sensor must have stopped.
func (*Store) DeadLetters ¶
func (s *Store) DeadLetters() deadletter.Store
DeadLetters is the dl/ tenant; its Close is a no-op, the store's Close closes the instance.
func (*Store) Load ¶
Load fills an empty store from a snapshot, before its views are used (ADR-0202 Loader); a store holding a dead letter or a seen list gets fault.Conflict before any write. In memory the seen/ records go to the MemWatermark.
func (*Store) SeenLists ¶
SeenLists is the seen/ tenant: heads and parts on disk, a MemWatermark in memory.