Skip to content

refactor: extract Queues and EnvelopeStore interfaces to decouple storage backends#41

Merged
wolfeidau merged 2 commits into
mainfrom
refactor_queues
Mar 7, 2026
Merged

refactor: extract Queues and EnvelopeStore interfaces to decouple storage backends#41
wolfeidau merged 2 commits into
mainfrom
refactor_queues

Conversation

@wolfeidau
Copy link
Copy Markdown
Member

  • Add EnvelopeStore interface to metadb; embed in MetaDB so all envelope
    methods are part of the unified storage contract
  • Add Queues interface to s3fifo; rename BoltDB-backed impl to BoltQueues
  • NewManager now takes Queues interface instead of *bbolt.DB
  • EnvelopeIndex takes EnvelopeStore instead of *BoltDB; creates its own
    EnvelopeCodec internally, removing the db.Codec() coupling
  • EnvelopeReaper takes EnvelopeStore; ExpiryReaper takes MetaDB
  • ExpiryReaper gains WithReaperNow option for test time control,
    parallel to EnvelopeReaper
  • server/http.go: type assertion to *BoltDB narrowed to S3-FIFO block only;
    all NewEnvelopeIndex calls use metaDB directly

…rage backends

- Add EnvelopeStore interface to metadb; embed in MetaDB so all envelope
  methods are part of the unified storage contract
- Add Queues interface to s3fifo; rename BoltDB-backed impl to BoltQueues
- NewManager now takes Queues interface instead of *bbolt.DB
- EnvelopeIndex takes EnvelopeStore instead of *BoltDB; creates its own
  EnvelopeCodec internally, removing the db.Codec() coupling
- EnvelopeReaper takes EnvelopeStore; ExpiryReaper takes MetaDB
- ExpiryReaper gains WithReaperNow option for test time control,
  parallel to EnvelopeReaper
- server/http.go: type assertion to *BoltDB narrowed to S3-FIFO block only;
  all NewEnvelopeIndex calls use metaDB directly
- Fix gofmt formatting in queues.go (missing space before method names)
- Split EnvelopeStore interface: separate EnvelopeExpiryStore for reaper,
  MetaExpiryStore for ExpiryReaper, keeping each type to its minimal surface
- Add WithEnvelopeIndexCodec option to share a single zstd codec across all
  EnvelopeIndex instances, restoring the one-encoder-per-process behaviour
@wolfeidau wolfeidau merged commit 8e54224 into main Mar 7, 2026
1 check passed
@wolfeidau wolfeidau deleted the refactor_queues branch March 7, 2026 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant