Avoid potential panics from nil or missing fields when migrating SRV
records by using comma-ok type assertions and guarding against empty
name/proto values.
Add Err() method to storage.Iterator interface and implement it on all
backends (LevelDB, PostgreSQL, in-memory). Update kvtpl.KVIterator.Err()
to fall through to the underlying iterator's error. Check Err() after
every iteration loop across kvtpl and usecase layers to surface I/O
failures and rate-limit errors instead of returning truncated data.
Extract common key-value storage operations into internal/storage/kvtpl/
template directory. This consolidates duplicated logic from both leveldb
and inmemory implementations into reusable generic functions.
Key changes:
- Create kvtpl/ package with generic KV storage operations
- Consolidate iterator implementation using generics
- Update migration functions to use new template structure
- Refactor tests to work with new storage interface
This prepares the codebase for easier addition of new storage backends
by providing a consistent template layer.
2026-01-09 17:17:04 +07:00
Renamed from internal/storage/leveldb/updates-from-7.go (Browse further)