-
Release 0.9.0 Stable
released this
2026-03-19 07:31:18 -06:00 | 0 commits to main since this releasev0.9.0
code.nochebuena.dev/go/valkeyOverview
valkeymanages the lifecycle of a valkey-go
client: constructs it from config, verifies connectivity at startup, exposes the native
client to consumers, and closes it gracefully on shutdown. Health checks run viaPING.This is the initial stable release. The API has been designed through multiple architecture
reviews and validated end-to-end via the todo-api POC. It is versioned v0.9.0 rather than
v1.0.0 because it has not yet been exercised across all production edge cases, and minor
API refinements may follow.What's Included
Config— connection settings loaded from environment variables:VK_ADDRS(required, comma-separated) — server addressesVK_PASSWORD— authentication passwordVK_DB— database index (default: 0)VK_CLIENT_CACHE_MB— per-connection client-side cache size in MB (default: 0, disabled)
Providerinterface —Client() valkey.Clientfor consumers that only need the native clientComponentinterface — embedslauncher.Component+health.Checkable+Providerfor
full lifecycle managementNew(logger, cfg) Component— constructor; register withlc.Append(vk)- Health check — issues
PING; priority ishealth.LevelDegraded(cache outage degrades
service but should not halt it) - Graceful shutdown —
OnStopcallsclient.Close()
Installation
go get code.nochebuena.dev/go/valkey@v0.9.0import "code.nochebuena.dev/go/valkey" vk := valkey.New(logger, valkey.Config{ Addrs: []string{"localhost:6379"}, }) lc.Append(vk)Design Highlights
Native client exposed directly.
Client()returnsvalkey.Clientfrom the
valkey-golibrary without any wrapping. Callers use the full command-builder API.
There is no re-exported subset.No serialisation helpers. Marshal and unmarshal belong in the caller or in a
separate cache repository layer. This module makes no assumptions about encoding.Optional client-side caching. Setting
CacheSizeEachConnto a non-zero MB value
enables valkey-go's built-in client-side cache per connection. Zero (the default)
disables it entirely.Health priority is Degraded, not Critical. A Valkey outage should degrade service
gracefully. Callers must handle cache misses by falling back to the primary datastore.Provider / Component split. Inject
Providerinto repositories and services that
only read or write keys. InjectComponentonly at the lifecycle registration site.Known Limitations & Edge Cases
- No serialisation helpers (
SetJSON,GetJSON, etc.). Callers handle all encoding. - No key namespacing. Key collision prevention is the caller's responsibility.
- Health check uses
PINGonly — it does not verify that specific keys or data are
accessible. Client()returnsnilbeforeOnInithas run. Guard against this in any code path
that may execute before the launcher has started the component.Config.Addrsis required. An empty slice will result in a client construction error
from the underlying library.
v0.9.0 → v1.0.0 Roadmap
- Validate production behaviour under connection churn and network partitions.
- Consider adding an optional
KeyPrefixtoConfigfor namespace isolation. - Evaluate whether a higher-level
Repositoryhelper (with generic get/set + TTL) belongs
here or in a separate module. - Harden health check with a configurable timeout distinct from the caller's context.
Downloads