diff --git a/README.md b/README.md index bec8f4be..92f80973 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ services: - name: twinnation # Name of your service, can be anything url: https://twinnation.org/actuator/health interval: 15s # Duration to wait between every status check (opt. default: 10s) - failure-threshold: 3 # TODO conditions: - "$STATUS == 200" - name: github diff --git a/config.yaml b/config.yaml index a6d7b30a..8fe126dc 100644 --- a/config.yaml +++ b/config.yaml @@ -2,7 +2,6 @@ services: - name: twinnation url: https://twinnation.org/actuator/health interval: 15s - failure-threshold: 3 conditions: - "$STATUS == 200" - name: github diff --git a/config/config.go b/config/config.go index b2756787..96bd5f51 100644 --- a/config/config.go +++ b/config/config.go @@ -34,9 +34,6 @@ func ParseConfigBytes(yamlBytes []byte) *Config { config = &Config{} yaml.Unmarshal(yamlBytes, config) for _, service := range config.Services { - if service.FailureThreshold == 0 { - service.FailureThreshold = 1 - } if service.Interval == 0 { service.Interval = 10 * time.Second } diff --git a/config/config_test.go b/config/config_test.go index fbe9e9e9..2b534521 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -12,7 +12,6 @@ services: - name: twinnation url: https://twinnation.org/actuator/health interval: 15s - failure-threshold: 3 conditions: - "$STATUS == 200" - name: github @@ -37,12 +36,6 @@ services: if config.Services[1].Interval != 10*time.Second { t.Errorf("Interval should have been %s, because it is the default value", 10*time.Second) } - if config.Services[0].FailureThreshold != 3 { - t.Errorf("FailureThreshold should have been %d", 3) - } - if config.Services[1].FailureThreshold != 1 { - t.Errorf("FailureThreshold should have been %d, because it is the default value", 1) - } if len(config.Services[0].Conditions) != 1 { t.Errorf("There should have been %d conditions", 1) } @@ -65,7 +58,4 @@ services: if config.Services[0].Interval != 10*time.Second { t.Errorf("Interval should have been %s, because it is the default value", 10*time.Second) } - if config.Services[0].FailureThreshold != 1 { - t.Errorf("FailureThreshold should have been %d, because it is the default value", 1) - } } diff --git a/core/types.go b/core/types.go index 3133688e..c471127d 100644 --- a/core/types.go +++ b/core/types.go @@ -33,11 +33,10 @@ type Result struct { } type Service struct { - Name string `yaml:"name"` - Url string `yaml:"url"` - Interval time.Duration `yaml:"interval,omitempty"` - FailureThreshold int `yaml:"failure-threshold,omitempty"` // TODO: Implement - Conditions []*Condition `yaml:"conditions"` + Name string `yaml:"name"` + Url string `yaml:"url"` + Interval time.Duration `yaml:"interval,omitempty"` + Conditions []*Condition `yaml:"conditions"` } func (service *Service) getIp(result *Result) {