local-server/cmd/dkl-local-server/data.go
2022-04-28 03:33:19 +02:00

21 lines
354 B
Go

package main
import (
"flag"
"path/filepath"
"novit.tech/direktil/pkg/localconfig"
)
var (
dataDir = flag.String("data", "/var/lib/direktil", "Data dir")
)
func configFilePath() string {
return filepath.Join(*dataDir, "config.yaml")
}
func readConfig() (config *localconfig.Config, err error) {
return localconfig.FromFile(configFilePath())
}