cache: add SQLite route persistence; initial TTL and LRU eviction implementation

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0370d6c114d5490634905c1a831a31526a6a6964
This commit is contained in:
raf 2026-03-05 23:58:11 +03:00
commit 663f9995b2
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
8 changed files with 674 additions and 5 deletions

View file

@ -8,9 +8,8 @@ import (
"gopkg.in/yaml.v3"
)
// Duration is a wrapper around time.Duration that supports YAML unmarshaling
// from Go duration strings (e.g., "30s", "1h"). yaml.v3 cannot unmarshal
// duration strings directly into time.Duration (int64), so we handle it here.
// Wrapper around time.Duration supporting YAML duration strings ("30s", "1h").
// yaml.v3 cannot unmarshal duration strings directly into time.Duration (int64).
type Duration struct {
time.Duration
}
@ -101,7 +100,7 @@ func defaults() Config {
}
}
// Load loads config from file (if non-empty) and applies env overrides.
// Loads config from file (if non-empty) and applies env overrides.
func Load(path string) (*Config, error) {
cfg := defaults()