Documentation
¶
Overview ¶
Package eventstream decodes the AWS application/vnd.amazon.eventstream framing used by Bedrock streaming responses.
Wire format (big-endian, network order):
+--------------------+ 4 bytes total length (incl. trailer CRC) +--------------------+ 4 bytes headers length +--------------------+ 4 bytes prelude CRC32 over the previous 8 bytes +--------------------+ headers (typed key/value pairs) +--------------------+ payload (totalLen - headersLen - 16) +--------------------+ 4 bytes message CRC32 over the entire message except the trailer
Header value types — only the ones Bedrock uses are decoded fully:
- 7 (string)
Other types are recognised so the framer doesn't crash, but their values are returned as raw bytes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTruncated = errors.New("eventstream: truncated frame")
ErrTruncated is returned when EOF arrives mid-frame.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.