Exosphere.ATProto.Firehose.Frame (Exosphere v0.2.0)

Copy Markdown View Source

Decode Exosphere.ATProto firehose WebSocket frames.

Each frame contains two concatenated DAG-CBOR objects:

  1. Header with op (operation) and t (type) fields
  2. Payload with the actual message data

Summary

Functions

Decode a binary WebSocket frame into {header, payload}.

Types

header()

@type header() :: %{op: integer(), t: String.t() | nil}

Functions

decode(data)

@spec decode(binary()) :: {:ok, header(), map()} | {:error, term()}

Decode a binary WebSocket frame into {header, payload}.