RigCloudEvents.Parser behaviour (Reactive Interaction Gateway v3.0.0-alpha.2) View Source
Tolerant reader for JSON encoded CloudEvents.
Link to this section Summary
Types
A CloudEvents context attribute name.
A CloudEvents extension name.
A JSON Pointer (see RFC 6901).
The JSON encoded CloudEvent.
Callbacks
Fetch the value of a CloudEvents context attribute.
Fetch the value of a CloudEvents extension attribute.
Find a specific value using a JSON Pointer.
Parse a JSON encoded CloudEvent.
Link to this section Types
Link to this section Callbacks
Specs
context_attribute(t(), attribute()) :: {:ok, value :: any()} | {:error, {:not_found, Parser.attribute(), t()}} | {:error, {:non_scalar_value, Parser.attribute(), t()}} | {:error, any()}
Fetch the value of a CloudEvents context attribute.
Specs
extension_attribute(t(), extension(), attribute()) :: {:ok, value :: any()} | {:error, {:not_found, Parser.attribute(), t()}} | {:error, {:not_an_object | :non_scalar_value, Parser.attribute(), t()}} | {:error, any()}
Fetch the value of a CloudEvents extension attribute.
Specs
find_value(t(), json_pointer()) :: {:ok, value :: any()} | {:error, {:not_found, location :: String.t(), t()}} | {:error, {:non_scalar_value, location :: String.t(), t()}} | {:error, any()}
Find a specific value using a JSON Pointer.
Specs
parse(json_string()) :: t()
Parse a JSON encoded CloudEvent.