Decoder for the AWS vnd.amazon.eventstream binary frame format used by Bedrock /converse-stream and Kinesis. Spec: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html
Each frame: [prelude (12 bytes)] [headers] [payload] [message-crc (4 bytes)] Prelude: [total-length (4 BE)] [headers-length (4 BE)] [prelude-crc (4 BE)] Each header: [name-len (1)] [name] [type (1)] [value-len (2 BE if variable)] [value]
We skip CRC validation (caller already trusts the AWS connection).
Decoder for the AWS vnd.amazon.eventstream binary frame format used by Bedrock /converse-stream and Kinesis. Spec: https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html Each frame: [prelude (12 bytes)] [headers] [payload] [message-crc (4 bytes)] Prelude: [total-length (4 BE)] [headers-length (4 BE)] [prelude-crc (4 BE)] Each header: [name-len (1)] [name] [type (1)] [value-len (2 BE if variable)] [value] We skip CRC validation (caller already trusts the AWS connection).
(frame->json {:keys [headers payload]})Decode a frame's payload as JSON, returning a map with :event-type, :content-type, and :data (parsed JSON map).
Decode a frame's payload as JSON, returning a map with :event-type, :content-type, and :data (parsed JSON map).
(frame-seq is)Lazy seq of decoded frames from an InputStream.
Lazy seq of decoded frames from an InputStream.
(read-frame in)Read one frame from a DataInputStream. Returns {:headers {} :payload <bytes>} or nil at EOF.
Read one frame from a DataInputStream. Returns
{:headers {} :payload <bytes>} or nil at EOF.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |