cake-order-tracker/config.go
2025-08-06 22:52:02 +02:00

31 lines
458 B
Go

package main
import (
_ "embed"
"time"
"github.com/BurntSushi/toml"
)
//go:embed config.default.toml
var defaultConfig string
var config struct {
Database struct {
File string
}
Server struct {
Addr string
ReadHeaderTimeout time.Duration
RequestTimeout time.Duration
}
}
func loadConfig() {
_, err := toml.Decode(defaultConfig, &config)
if err != nil {
panic(err)
}
_, _ = toml.DecodeFile("config.toml", &config)
}