ProtoRune. Jetstream. Event
(proto_rune v0.5.2)
Copy Markdown
A single event decoded from a Jetstream JSON message.
Jetstream is a JSON re-encode of the repo firehose with server-side filtering, so events arrive already decoded: no CAR slicing and no CBOR. The record of a commit operation comes inline in the message.
Fields
:type- the event type::commit,:identity,:accountor:unknown.:did- the DID of the repository the event belongs to.:time_us- the event timestamp in microseconds since the Unix epoch. Feed it back as the:cursoroption ofProtoRune.Jetstream.start_link/1to resume the stream.:collection- the record collection (:commitevents only).:rkey- the record key (:commitevents only).:operation-:create,:updateor:delete(:commitevents only).:cid- the record CID as a string (:commitevents only,nilfor deletions).:rev- the repository revision (:commitevents only).:record- the decoded record for:createand:updateoperations,nilfor deletions.:payload- the raw decoded message, for fields this module does not know about.
Summary
Functions
Builds an event from a JSON-decoded Jetstream message.
Types
@type operation() :: :create | :update | :delete
@type t() :: %ProtoRune.Jetstream.Event{ cid: String.t() | nil, collection: String.t() | nil, did: String.t() | nil, operation: operation() | nil, payload: map(), record: map() | nil, rev: String.t() | nil, rkey: String.t() | nil, time_us: non_neg_integer() | nil, type: :commit | :identity | :account | :unknown }