local-server/cmd/dkl-local-server/data.go

21 lines
352 B
Go
Raw Normal View History

2018-06-12 10:09:47 +00:00
package main
import (
"flag"
"path/filepath"
2018-12-10 10:59:24 +00:00
"novit.nc/direktil/pkg/localconfig"
2018-06-12 10:09:47 +00:00
)
var (
2019-01-30 02:56:45 +00:00
dataDir = flag.String("data", "/var/lib/direktil", "Data dir")
2018-06-12 10:09:47 +00:00
)
2019-01-22 20:51:05 +00:00
func configFilePath() string {
return filepath.Join(*dataDir, "config.yaml")
}
2018-06-20 02:59:15 +00:00
2019-01-22 20:51:05 +00:00
func readConfig() (config *localconfig.Config, err error) {
return localconfig.FromFile(configFilePath())
2018-06-12 10:09:47 +00:00
}