webhooks_emitter v0.1.3 WebhooksEmitter.Interface behaviour View Source

Specification for WebhooksEmitter

Link to this section Summary

Link to this section Types

Link to this type

emitter_config()

View Source
emitter_config() :: WebhooksEmitter.Config.t()
Link to this type

emitter_id()

View Source
emitter_id() :: term()
Link to this type

event_name()

View Source
event_name() :: String.t() | atom()
Link to this type

event_names()

View Source
event_names() :: [event_name(), ...]
Link to this type

event_payload()

View Source
event_payload() :: map()
Link to this type

request_id()

View Source
request_id() :: String.t() | nil

Link to this section Callbacks

Link to this callback

attach(emitter_id, event_name, emitter_config)

View Source
attach(emitter_id(), event_name(), emitter_config()) ::
  :ok | {:error, :already_exists}
Link to this callback

attach_many(emitter_id, event_names, emitter_config)

View Source
attach_many(emitter_id(), event_names(), emitter_config()) ::
  :ok | {:error, :already_exists}
Link to this callback

detach(emitter_id)

View Source
detach(emitter_id()) :: :ok
Link to this callback

emit(event_name, event_payload, request_id)

View Source
emit(event_name(), event_payload(), request_id()) :: {:ok, request_id()}