sdk: actually no, let's store all relay urls together in the same kvdb key.

This commit is contained in:
fiatjaf
2025-01-16 10:49:45 -03:00
parent 4cf9631c28
commit 46569b6ef4
7 changed files with 180 additions and 98 deletions

View File

@@ -14,7 +14,9 @@ type KVStore interface {
// Close releases any resources held by the store
Close() error
// Scan iterates through all keys with the given prefix.
// For each key-value pair, fn is called. If fn returns false, iteration stops.
Scan(prefix []byte, fn func(key []byte, value []byte) bool) error
// Update atomically modifies a value for a given key.
// The function f receives the current value (nil if not found)
// and returns the new value to be set.
// If f returns nil, the key is deleted.
Update(key []byte, f func([]byte) ([]byte, error)) error
}