• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

alexferl / zerohttp / 23676850822
94%

Build:
DEFAULT BRANCH: master
Ran 28 Mar 2026 03:51AM UTC
Jobs 1
Files 89
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Mar 2026 03:50AM UTC coverage: 93.496% (+0.04%) from 93.456%
23676850822

push

github

web-flow
feat(storage): add shared storage interface and middleware adapters (#151)

* feat(storage): add shared storage interface and middleware adapters

Add a global `storage.Storage` interface that can be shared across
middlewares instead of implementing separate interfaces for each.

- Add `storage.Storage` interface (Get, Set, Delete, Close)
- Add optional `storage.Locker` interface for locking operations
- Add `storage.Locker` interface for lock/unlock operations
- Create middleware-specific adapters that wrap storage.Storage:
    - `cache.NewStorageAdapter()` - handles JSON serialization
    - `idempotency.NewStorageAdapter()` - requires Locker interface
- Add Close() method to all Store interfaces (cache, idempotency,
  ratelimit, jwtauth) and their implementations
- Rename store files for consistency (cache_store.go → store.go, etc.)
- Add idempotency_redis example with full Store implementation
- Update cache_redis and ratelimit_redis examples with Close()/Delete()
- Update all JWT example stores with Close() method

Signed-off-by: alexferl <me@alexferl.com>

* feat(idempotency): add custom codec support to adapter

Add Codec interface and JSONCodec implementation to idempotency adapter,
matching the cache adapter pattern. Allows users to provide custom
serialization (e.g., msgpack, protobuf) via StorageAdapterConfig.

- Add Codec interface with Marshal/Unmarshal methods
- Add JSONCodec as default implementation
- Add Codec field to StorageAdapterConfig with zconfig.Merge support
- Update Get/Set to use codec instead of direct json.Marshal/Unmarshal
- Add tests for custom codec configuration

Signed-off-by: alexferl <me@alexferl.com>

---------

Signed-off-by: alexferl <me@alexferl.com>

89 of 95 new or added lines in 6 files covered. (93.68%)

5 existing lines in 2 files now uncovered.

9775 of 10455 relevant lines covered (93.5%)

409.42 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
90.48
middleware/idempotency/adapter.go
2
93.94
middleware/cache/adapter.go

Coverage Regressions

Lines Coverage ∆ File
3
96.9
-0.58% router.go
2
95.24
0.0% sse/sse.go
Jobs
ID Job ID Ran Files Coverage
1 23676850822.1 28 Mar 2026 03:51AM UTC 89
93.5
GitHub Action Run
Source Files on build 23676850822
  • Tree
  • List 89
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #23676850822
  • a7a735e8 on github
  • Prev Build on master (#23574317084)
  • Next Build on master (#23688405301)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc