HasEvent returns true if a status event is in the Events slice. Also returns true if the Events slice has only one value of WAITING.
(e ExtractStatus)
| 330 | // HasEvent returns true if a status event is in the Events slice. |
| 331 | // Also returns true if the Events slice has only one value of WAITING. |
| 332 | func (w *WebhookConfig) HasEvent(e ExtractStatus) bool { |
| 333 | for _, status := range w.Events { |
| 334 | if (status == WAITING && len(w.Events) == 1) || status == e { |
| 335 | return true |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | return false |
| 340 | } |
| 341 | |
| 342 | // WebhookCounts returns the total count of requests and errors for all webhooks. |
| 343 | func (u *Unpackerr) WebhookCounts() (uint, uint) { |