Check performs checks using c according to its configuration. An error is only returned if there is a configuration error.
()
| 81 | // Check performs checks using c according to its configuration. |
| 82 | // An error is only returned if there is a configuration error. |
| 83 | func (c Checker) Check() (types.Result, error) { |
| 84 | if c.Attempts < 1 { |
| 85 | c.Attempts = 1 |
| 86 | } |
| 87 | |
| 88 | result := types.NewResult() |
| 89 | result.Title = c.Name |
| 90 | result.Endpoint = c.Command |
| 91 | result.Times = c.doChecks() |
| 92 | |
| 93 | return c.conclude(result), nil |
| 94 | } |
| 95 | |
| 96 | // doChecks executes command and returns each attempt. |
| 97 | func (c Checker) doChecks() types.Attempts { |