diff options
Diffstat (limited to 'plugins/service/config.go')
-rw-r--r-- | plugins/service/config.go | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/plugins/service/config.go b/plugins/service/config.go deleted file mode 100644 index 871c8f76..00000000 --- a/plugins/service/config.go +++ /dev/null @@ -1,34 +0,0 @@ -package service - -import "time" - -// Service represents particular service configuration -type Service struct { - Command string `mapstructure:"command"` - ProcessNum int `mapstructure:"process_num"` - ExecTimeout time.Duration `mapstructure:"exec_timeout"` - RemainAfterExit bool `mapstructure:"remain_after_exit"` - RestartSec uint64 `mapstructure:"restart_sec"` -} - -// Config for the services -type Config struct { - Services map[string]Service `mapstructure:"service"` -} - -func (c *Config) InitDefault() { - if len(c.Services) > 0 { - for k, v := range c.Services { - if v.ProcessNum == 0 { - val := c.Services[k] - val.ProcessNum = 1 - c.Services[k] = val - } - if v.RestartSec == 0 { - val := c.Services[k] - val.RestartSec = 30 - c.Services[k] = val - } - } - } -} |