AWSEventStream.Header (AWSEventStream v0.1.0)

Copy Markdown View Source

A single AWS event-stream header value and its wire codec.

Wire triple: name_len:u8 + name + value_type:u8 + value. All ~10 AWS value types are supported. Numeric values are signed big-endian; timestamps are DateTime at millisecond precision; uuids are raw 16-byte binaries.

Summary

Functions

Decode a concatenated headers blob into a list of headers in wire order.

Encode a header to its wire-format iodata.

Types

t()

@type t() :: %AWSEventStream.Header{
  name: String.t(),
  type: value_type(),
  value: term()
}

value_type()

@type value_type() ::
  :bool
  | :byte
  | :short
  | :integer
  | :long
  | :bytes
  | :string
  | :timestamp
  | :uuid

Functions

decode_all(bin)

@spec decode_all(binary()) :: [t()]

Decode a concatenated headers blob into a list of headers in wire order.

encode(header)

@spec encode(t()) :: iodata()

Encode a header to its wire-format iodata.