feat: config

This commit is contained in:
2025-08-24 14:23:51 +02:00
parent 0f3da902dc
commit 958979c62b
9 changed files with 159 additions and 86 deletions

21
types.go Normal file
View File

@@ -0,0 +1,21 @@
package main
import (
"encoding/json"
"time"
)
type Duration time.Duration
func (d *Duration) UnmarshalJSON(b []byte) error {
var s string
if err := json.Unmarshal(b, &s); err != nil {
return err
}
tmp, err := time.ParseDuration(s)
if err != nil {
return err
}
*d = Duration(tmp)
return nil
}