Safe Haskell | None |
---|---|
Language | Haskell2010 |
Event stream encoding provides bidirectional communication using messages between a client and a server. Data frames sent to the Amazon Transcribe streaming service are encoded in this format. The response from Amazon Transcribe also uses this encoding.
Each message consists of two sections: the prelude and the data. The prelude consists of:
The total byte length of the message
The combined byte length of all of the headers
The data section consists of:
The headers
A payload
Each section ends with a 4-byte big-endian integer CRC checksum. The message CRC checksum is for both the prelude section and the data section. Amazon Transcribe uses CRC32 (often referred to as GZIP CRC32) to calculate both CRCs. For more information about CRC32, see GZIP file format specification version 4.3
.
Total message overhead, including the prelude and both checksums, is 16 bytes.
documentation source: https://docs.aws.amazon.com/transcribe/latest/dg/event-stream.html
Synopsis
- data Message = MkMessage {
- _hContentType :: !Header
- _hEventType :: !Header
- _hMessageType :: !Header
- _payload :: !ByteString
- data Header = MkHeader {
- _hNameLength :: !Word8
- _hName :: !Text
- _hValueType :: !Word8
- _hValueStringLength :: !Int16
- _hValueString :: !Text
- payload :: Lens' Message ByteString
- hMessageType :: Lens' Message Header
- hEventType :: Lens' Message Header
- hContentType :: Lens' Message Header
- hValueType :: Lens' Header Word8
- hValueStringLength :: Lens' Header Int16
- hValueString :: Lens' Header Text
- hNameLength :: Lens' Header Word8
- hName :: Lens' Header Text
- classifyHeaders :: Header -> Header -> Header -> (Header, Header, Header)
- tbl :: Message -> Int32
- hbl :: Int32
- pbl :: Message -> Int32
- headerBuilder :: Header -> Builder
- getHeader :: Get Header
- crcBuilder :: Builder -> Builder
- hContentTypeRequest :: Header
- hContentTypeRequestBL :: Int32
- hEventTypeRequest :: Header
- hEventTypeRequestBL :: Int32
- hMessageTypeRequest :: Header
- hMessageTypeRequestBL :: Int32
- requestMessageHeaders :: Builder
- mkStreamingMessage :: ByteString -> Message
Documentation
MkMessage | |
|
Event stram encoding header
MkHeader | |
|
headerBuilder :: Header -> Builder Source #
crcBuilder :: Builder -> Builder Source #
mkStreamingMessage :: ByteString -> Message Source #
Make a streaming message, using the default request headers