2021-01-01 09:26:49 -09:00
|
|
|
package config
|
|
|
|
|
2021-01-17 09:04:08 -09:00
|
|
|
type Host struct {
|
2021-11-14 07:04:25 -09:00
|
|
|
Name string `yaml:"name"`
|
|
|
|
Address string `yaml:"address"`
|
|
|
|
Checks []Check `yaml:"checks"`
|
2021-01-01 09:26:49 -09:00
|
|
|
}
|
|
|
|
|
2021-11-14 07:04:25 -09:00
|
|
|
func (hst *Host) NameOrAddress() string {
|
|
|
|
if hst.Name == "" {
|
|
|
|
return hst.Address
|
2021-01-01 09:26:49 -09:00
|
|
|
}
|
2021-11-14 07:04:25 -09:00
|
|
|
return hst.Name
|
2021-01-01 09:26:49 -09:00
|
|
|
}
|