summaryrefslogtreecommitdiff
path: root/src/rhctl/conf.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/rhctl/conf.go')
-rw-r--r--src/rhctl/conf.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/rhctl/conf.go b/src/rhctl/conf.go
index 8df11f0..3e35abb 100644
--- a/src/rhctl/conf.go
+++ b/src/rhctl/conf.go
@@ -73,6 +73,19 @@ type Config struct {
HeartbeatThreshold uint `toml:"heartbeat_threshold"`
}
+ Timing struct {
+ Settling struct {
+ Awakening Duration `toml:"awakening"`
+ SelectServer Duration `toml:"select_server"`
+ UpdateStates Duration `toml:"update_states"`
+ }
+
+ StaleStates struct {
+ CheckInterval Duration `toml:"check_interval"`
+ MaxAge Duration `toml:"max_age"`
+ }
+ }
+
Clients struct {
Web struct {
Address string `toml:"addr"`
@@ -90,6 +103,9 @@ type Duration struct {
func (d *Duration) UnmarshalTOML(data []byte) (err error) {
ds := strings.Trim(string(data), "\"")
d.Duration, err = time.ParseDuration(ds)
+ if err == nil && d.Duration < 0 {
+ err = errors.New("negative durations are not allowed")
+ }
return
}