FYI.Event (FYI v1.0.2)
View SourceRepresents an event in the FYI system.
An event has:
name- dot-separated event name (e.g., "purchase.created")payload- arbitrary map of event dataactor- who/what triggered the event (user_id, system, etc.)tags- additional metadata for filtering/routingsource- where the event originatedoccurred_at- when the event happened
Summary
Functions
Creates a new event with the given name and payload.
Types
Functions
Creates a new event with the given name and payload.
Options
:actor- who triggered the event (user_id, email, etc.):tags- additional metadata map:source- where the event originated:emoji- override emoji for this specific event
Examples
iex> FYI.Event.new("purchase.created", %{amount: 4900})
%FYI.Event{name: "purchase.created", payload: %{amount: 4900}, ...}
iex> FYI.Event.new("user.signup", %{email: "user@example.com"}, actor: "user_123")
%FYI.Event{name: "user.signup", actor: "user_123", ...}
iex> FYI.Event.new("error.critical", %{}, emoji: "🚨")
%FYI.Event{name: "error.critical", emoji: "🚨", ...}