local-server/cmd/dkl-local-server/data.go
Mikaël Cluseau a9454af71b sanity
2019-01-30 13:58:13 +11:00

21 lines
352 B
Go

package main
import (
"flag"
"path/filepath"
"novit.nc/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())
}