clonepack/config/config.go
GnomeZworc 274ea454dd
first with full handle over rpm
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-04-25 14:50:08 +02:00

31 lines
625 B
Go

package config
import "time"
type Config struct {
Server ServerConfig `mapstructure:"server"`
DB DBConfig `mapstructure:"db"`
DataDir string `mapstructure:"data_dir"`
Sync SyncConfig `mapstructure:"sync"`
}
type ServerConfig struct {
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
}
type DBConfig struct {
Path string `mapstructure:"path"`
}
type SyncConfig struct {
Interval string `mapstructure:"interval"`
}
func (s SyncConfig) IntervalDuration() time.Duration {
d, err := time.ParseDuration(s.Interval)
if err != nil || d <= 0 {
return time.Hour
}
return d
}