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:
parent
9f264fbef1
commit
663f9995b2
8 changed files with 674 additions and 5 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue