ProtoRune. Firehose. Event
(proto_rune v0.3.0)
Copy Markdown
A single event decoded from the ATProto firehose.
Fields
:type- the event type::commit,:identity,:account,:handle,:migrate,:tombstone,:info,:erroror:unknown.:seq- the sequence number of the event. Feed it back as the:cursoroption ofProtoRune.Firehoseto resume the stream from this point.:repo- the DID of the repository the event belongs to.:time- the event timestamp as an ISO 8601 string.:rev- the repository revision (:commitevents only).:ops- the repository operations of a:commitevent.:blocks- the repository blocks of a:commitevent, CBOR-decoded and keyed by CID string. The record for an operation can be found atevent.blocks[to_string(op.cid)].:payload- the raw decoded frame payload, for event types without dedicated fields and for fields this module does not know about.
Summary
Types
@type op() :: %{ action: :create | :update | :delete, path: String.t(), cid: ProtoRune.CID.t() | nil }
A repository operation within a :commit event.
:action-:create,:updateor:delete.:path- the record path, e.g."app.bsky.feed.post/3jxfb3nkkf22v".:cid- the record CID (nilfor deletions).
@type t() :: %ProtoRune.Firehose.Event{ blocks: %{optional(String.t()) => term()}, ops: [op()], payload: map(), repo: String.t() | nil, rev: String.t() | nil, seq: non_neg_integer() | nil, time: String.t() | nil, type: :commit | :identity | :account | :handle | :migrate | :tombstone | :info | :error | :unknown }