ASM.Extensions.PubSub.Payload (ASM v0.9.2)

Copy Markdown View Source

Canonical payload contract for PubSub broadcast events.

Payload shape (asm.pubsub.event.v1):

%{
  schema: "asm.pubsub.event.v1",
  event: %ASM.Event{},
  meta: %{
    event_id: String.t(),
    event_kind: atom(),
    session_id: String.t(),
    run_id: String.t(),
    provider: atom() | nil,
    published_at: DateTime.t(),
    source: atom(),
    topics: [String.t()]
  }
}

Summary

Types

meta()

@type meta() :: %{
  :event_id => String.t(),
  :event_kind => ASM.Event.kind(),
  :session_id => String.t(),
  :run_id => String.t(),
  :provider => atom() | nil,
  :published_at => DateTime.t(),
  :source => atom(),
  optional(:topics) => [String.t()]
}

t()

@type t() :: %{schema: String.t(), event: ASM.Event.t(), meta: meta()}

Functions

build(event, opts \\ [])

@spec build(
  ASM.Event.t(),
  keyword()
) :: t()

schema()

@spec schema() :: String.t()