# `Hemdal.Event`
[🔗](https://github.com/altenwald/hemdal/blob/v1.4.0/lib/hemdal/event.ex#L1)

Generate events to be consumed. It's the producer for the events.

# `t`

```elixir
@type t() :: %Hemdal.Event{
  alert: Hemdal.Config.Alert.t() | nil,
  fail_duration: non_neg_integer(),
  fail_started: NaiveDateTime.t() | nil,
  last_update: NaiveDateTime.t(),
  metadata: map(),
  prev_status: Hemdal.Check.status(),
  status: Hemdal.Check.status()
}
```

The event is generated usually in `Hemdal.Check` module and it's
based on the structure:

- `alert` based on `Hemdal.Config.Alert`
- `status` which is the current status to notify
- `prev_status` which is the previous status
- `fail_started` when the fail started to happens
- `fail_duration` how long the fail is/was
- `last_update` when the event was created
- `metadata` more information for the event

# `notify`

```elixir
@spec notify(t()) :: :ok
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
