AddHealthcheck adds a Healthcheck to a VserverEntry.
(h *Healthcheck)
| 255 | |
| 256 | // AddHealthcheck adds a Healthcheck to a VserverEntry. |
| 257 | func (v *VserverEntry) AddHealthcheck(h *Healthcheck) error { |
| 258 | key := h.Key() |
| 259 | if _, ok := v.Healthchecks[key]; ok { |
| 260 | return fmt.Errorf("VserverEntry %q already contains Healthcheck %q", v.Key(), key) |
| 261 | } |
| 262 | v.Healthchecks[key] = h |
| 263 | return nil |
| 264 | } |
| 265 | |
| 266 | // Key returns the unique identifier for a VserverEntry. |
| 267 | func (v *VserverEntry) Key() string { |
no test coverage detected