View Source Polyn.Event (Polyn v0.1.0)

The Event structure used throughout Polyn.

Link to this section Summary

Types

Previous events that led to this one

t()

The Event structure used throughout Polyn.

Functions

Get the Event source prefixed with reverse domain name

Get the Event type prefixed with reverse domain name

Create a new Polyn.Event

Generate a new event id

Generate a new timestamp for the event

Link to this section Types

@type polyntrace() :: %{type: binary(), time: binary(), id: binary()}

Previous events that led to this one

@type t() :: %Polyn.Event{
  data: any(),
  datacontenttype: String.t(),
  dataschema: String.t(),
  id: String.t(),
  polyndata: map(),
  polyntrace: [polyntrace()],
  source: String.t(),
  specversion: String.t(),
  time: String.t(),
  type: String.t()
}

The Event structure used throughout Polyn.

  • id - Identifies the event.
  • specversion - The version of the CloudEvents specification which the event uses.
  • type - Describes the type of event related to the originating occurrence.
  • data - The event payload.
  • dataschema - Identifies the schema that data adheres to.
  • datacontenttype - Content type of the data value. Must adhere to RFC 2046 format.
  • source - Identifies the context in which an event happened.
  • time - Timestamp of when the occurrence happened. Must adhere to RFC 3339.
  • polyntrace - Previous events that led to this one
  • polyndata - Information about the client that produced the event and additional data

Link to this section Functions

@spec full_source() :: binary()
@spec full_source(source :: binary() | nil) :: binary()

Get the Event source prefixed with reverse domain name

@spec full_type(type :: binary()) :: binary()

Get the Event type prefixed with reverse domain name

@spec new(fields :: keyword()) :: t()
@spec new(fields :: map()) :: t()

Create a new Polyn.Event

Generate a new event id

Generate a new timestamp for the event