Valkey (Redis-compatible) client component with launcher lifecycle and health check integration. What's included: - Config with Addrs, Password, SelectDB, CacheSizeEachConn (env-driven) - Provider interface exposing native valkey-go Client() directly (no wrapper) - Component interface: launcher.Component + health.Checkable + Provider - New(logger, cfg) constructor for lifecycle registration via lc.Append - Health check via PING at LevelDegraded priority - Graceful shutdown calling client.Close() in OnStop Tested-via: todo-api POC integration Reviewed-against: docs/adr/
30 lines
2.1 KiB
Markdown
30 lines
2.1 KiB
Markdown
# Changelog
|
|
|
|
All notable changes to this module will be documented in this file.
|
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
and this module adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
## [0.9.0] - 2026-03-18
|
|
|
|
### Added
|
|
|
|
- `Config` struct — Valkey connection settings loaded from environment variables: `VK_ADDRS` (required, comma-separated server addresses), `VK_PASSWORD` (authentication password), `VK_DB` (database index, default `0`), `VK_CLIENT_CACHE_MB` (per-connection client-side cache size in MB, default `0` disables caching)
|
|
- `Provider` interface — `Client() valkey.Client`; for consumers that only need access to the native `valkey-go` client
|
|
- `Component` interface — embeds `launcher.Component`, `health.Checkable`, and `Provider`; the full lifecycle-managed surface registered with the launcher
|
|
- `New(logger logz.Logger, cfg Config) Component` — constructor; returns a `Component` ready for `lc.Append`
|
|
- `OnInit` — constructs the `valkey-go` client from `Config`; enables client-side caching when `CacheSizeEachConn > 0`
|
|
- `OnStart` — verifies connectivity by issuing a `PING` command; returns an error if the ping fails
|
|
- `OnStop` — calls `client.Close()` for graceful shutdown
|
|
- `HealthCheck(ctx context.Context) error` — issues `PING`; returns an error if the client is nil or the command fails
|
|
- `Name() string` — returns `"valkey"`
|
|
- `Priority() health.Level` — returns `health.LevelDegraded`; a cache outage degrades service rather than halting it
|
|
|
|
### Design Notes
|
|
|
|
- The native `valkey-go` client is exposed directly via `Client()` with no wrapping or re-exported command subset; callers use the full command-builder API and own all serialisation and key namespacing.
|
|
- `Provider` / `Component` split follows the framework pattern: inject `Provider` into repositories and services, inject `Component` only at the lifecycle registration site.
|
|
- Health priority is `LevelDegraded` by design — callers must handle cache misses by falling back to the primary datastore rather than treating a Valkey outage as fatal.
|
|
|
|
[0.9.0]: https://code.nochebuena.dev/go/valkey/releases/tag/v0.9.0
|