View Source Domainex.Event (domainex v0.1.0)

Event described on this module is specified for domain's event. It provides a base event's structure and also a behaviour to handle all available events.

Summary

Functions

is_event?/1 used to check if given tuple is an event or not

new/2 used to generate new Event structure with given name and payload. The payload itself may be a struct() or map() depends on business logic needs.

payload/1 used to extract event's payload from given event's tuple

structure/1 used to extract base event's structure

Functions

Link to this function

error_invalid_event_type()

View Source
@spec error_invalid_event_type() :: binary()
@spec is_event?(given :: tuple()) :: boolean()

is_event?/1 used to check if given tuple is an event or not

@spec new(name :: Domainex.event_name(), payload :: Domainex.event_payload()) ::
  Domainex.event()

new/2 used to generate new Event structure with given name and payload. The payload itself may be a struct() or map() depends on business logic needs.

@spec payload(event :: Domainex.event()) :: Domainex.result()

payload/1 used to extract event's payload from given event's tuple

@spec structure(event :: Domainex.event()) :: Domainex.result()

structure/1 used to extract base event's structure