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

21 lines
354 B
Go
Raw Normal View History

2018-06-12 10:09:47 +00:00
package main
import (
"flag"
"path/filepath"
2022-04-28 01:33:19 +00:00
"novit.tech/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
}