RigCloudEvents.CloudEvent (Reactive Interaction Gateway v3.0.0-alpha.2) View Source

CloudEvents is a vendor-neutral specification for defining the format of event data.

See: https://github.com/cloudevents

Link to this section Summary

Functions

Initialize a new CloudEvent given a JSON string.

Initialize a new CloudEvent or raise.

Link to this section Types

Specs

t() :: %RigCloudEvents.CloudEvent{
  json: String.t(),
  parsed: RigCloudEvents.Parser.PartialParser.t()
}

Link to this section Functions

Link to this function

find_value(event, json_pointer)

View Source

Specs

find_value(t(), json_pointer :: String.t()) ::
  {:ok, value :: any()} | {:error, any()}

Specs

parse(String.t()) :: {:ok, t()} | {:error, any()}
parse(map()) :: {:ok, t()} | {:error, any()}

Initialize a new CloudEvent given a JSON string.

The given JSON string is decoded to an object and fields that are relevant for RIG are checked for validity. However, note that this function does not implement the full specification - a successful pass does not necessarily mean the given JSON contains a valid CloudEvent according to the CloudEvents spec.

Specs

parse!(String.t() | map()) :: t()

Initialize a new CloudEvent or raise.

See parse/1.