diff options
Diffstat (limited to 'plugins/jobs/drivers/beanstalk/config.go')
-rw-r--r-- | plugins/jobs/drivers/beanstalk/config.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/plugins/jobs/drivers/beanstalk/config.go b/plugins/jobs/drivers/beanstalk/config.go index d034d65c..caa683ab 100644 --- a/plugins/jobs/drivers/beanstalk/config.go +++ b/plugins/jobs/drivers/beanstalk/config.go @@ -1 +1,22 @@ package beanstalk + +import "time" + +type GlobalCfg struct { + Addr string `mapstructure:"addr"` + Timeout time.Duration `mapstructure:"timeout"` +} + +func (c *GlobalCfg) InitDefault() { + if c.Addr == "" { + c.Addr = "tcp://localhost:11300" + } + + if c.Timeout == 0 { + c.Timeout = time.Second * 30 + } +} + +type Config struct{} + +func (c *Config) InitDefault() {} |