EventBus v1.0.0 EventBus.Event View Source

Represents a Event

Link to this section Summary

Functions

Creates new Event's struct

Link to this section Types

Link to this type

t() View Source
t() :: %EventBus.Event{event: binary(), payload: map(), version: binary()}

Link to this section Functions

Link to this function

new(event_name, payload) View Source
new(binary(), map()) :: {:ok, t()} | {:error, atom(), list()}

Creates new Event's struct

Examples

iex> EventBus.Event.new("user_blocked", %{"user_id" => 1})
{:ok,
  %EventBus.Event{
  event: "user_blocked",
  payload: %{user_id: 1},
  version: "2019-05-11"
}}