KubeMQ.EventStore (kubemq v1.0.1)

Copy Markdown View Source

Persistent event message for the KubeMQ Events Store pattern.

Unlike regular events, store events are persisted and can be replayed from various start positions. The store field is always true internally.

Fields

  • id (String.t() | nil) — Unique event identifier. Auto-generated by the server if nil.

  • channel (String.t()) — Target channel name. Required for sending.
  • metadata (String.t() | nil) — Optional metadata string.

  • body (binary() | nil) — Message payload.

  • client_id (String.t() | nil) — Sender identifier. Set automatically by KubeMQ.Client.

  • tags (%{String.t() => String.t()}) — Key-value tags for filtering. Default: %{}.

Usage

event = KubeMQ.EventStore.new(channel: "audit-log", body: "user login")
{:ok, result} = KubeMQ.Client.send_event_store(client, event)

Summary

Functions

Create a new EventStore struct from keyword options.

Types

t()

@type t() :: %KubeMQ.EventStore{
  body: binary() | nil,
  channel: String.t(),
  client_id: String.t() | nil,
  id: String.t() | nil,
  metadata: String.t() | nil,
  tags: %{required(String.t()) => String.t()}
}

Functions

new(opts \\ [])

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

Create a new EventStore struct from keyword options.

Options

  • :id — Event ID string (auto-generated if nil)
  • :channel — Target channel name (required for sending)
  • :metadata — Metadata string
  • :body — Message body (binary)
  • :client_id — Client identifier (set automatically by KubeMQ.Client)
  • :tags — Key-value tags map (default: %{})

Examples

iex> event = KubeMQ.EventStore.new(channel: "audit-log", body: "user login")
iex> event.channel
"audit-log"
iex> event.body
"user login"