Skip to content

Feat/one writer mode#24

Merged
CreditWorthy merged 5 commits intomainfrom
feat/one-writer-mode
Feb 21, 2026
Merged

Feat/one writer mode#24
CreditWorthy merged 5 commits intomainfrom
feat/one-writer-mode

Conversation

@CreditWorthy
Copy link
Owner

No description provided.

- CONTRIBUTING.md with build, test, style guide, PR process
- CHANGELOG.md for v0.1.0 (unreleased)
- Issue templates: bug report and feature request
- Godoc comments on all exported types and functions
Remove unused middle 'options' slot from struct tag parser.
Tags are now mmap:"name,64" instead of mmap:"name,,64".
Add WithOneWriter() and WithReadOnly() functional options for CreateStore
and OpenStore. WithOneWriter acquires an exclusive flock on a sidecar .lock
file, ensuring only one writer process at a time. WithReadOnly maps the file
with PROT_READ only, skips seqlock recovery, skips flush/sync on Close, and
rejects all write operations.

- Add StoreOption type, WithReadOnly(), WithOneWriter() (options.go)
- Add flockExclusive/funlock helpers (lock_unix.go)
- Add ErrLocked sentinel error (errors.go)
- Guard SeqBeginWrite on read-only stores (store_seq.go)
- Update codegen template to pass opts through (store.tmpl)
- Regenerate example/marketcap_store.go
- Fix Store.writable field bug in OpenStore (was hardcoded to true)
- Fix struct field alignment in Store
- Add 100% test coverage for all new code
- Add read-only and one-writer benchmarks

Closes #14
Closes #15
@codecov
Copy link

codecov bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Files with missing lines Coverage Δ
example/marketcap_store.go 100.00% <100.00%> (ø)
lock_unix.go 100.00% <100.00%> (ø)
options.go 100.00% <100.00%> (ø)
store.go 100.00% <100.00%> (ø)
store_seq.go 100.00% <100.00%> (ø)

@CreditWorthy CreditWorthy merged commit 1328ceb into main Feb 21, 2026
3 checks passed
@CreditWorthy CreditWorthy deleted the feat/one-writer-mode branch February 21, 2026 19:11
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