wip: config

This commit is contained in:
2023-12-08 15:15:35 +11:00
parent eb7bde3cbe
commit bd4ba67ad2
3 changed files with 311 additions and 26 deletions
+3 -3
View File
@@ -19,10 +19,9 @@ const (
type Config struct {
servicePaths []string
cron []*cron
}
type cron struct{}
func Read() (*Config, error) {
viper.SetEnvPrefix(EnvPrefix)
viper.BindEnv(EnvConfigPath)
@@ -34,7 +33,7 @@ func Read() (*Config, error) {
svcdir string
serviceAvailable bool
cronAvailable bool
cron []cron
cron []*cron
crontabfile string
)
@@ -61,6 +60,7 @@ func Read() (*Config, error) {
crontabfile = filepath.Join(configPath, CrontabFileName)
cron, err = readCrontab(crontabfile)
if len(cron) > 0 {
outConfig.cron = cron
cronAvailable = true
}
if err != nil {