Maintainer | Toshio Ito <debug.ito@gmail.com> |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data Codec s = Codec {
- mimeType :: Text
- encodeWith :: RequestMessage -> ByteString
- decodeWith :: ByteString -> Either String (ResponseMessage s)
- encodeBinaryWith :: Codec s -> RequestMessage -> ByteString
- messageHeader :: Text -> ByteString
- decodeBinary :: ByteString -> Either String (Text, ByteString)
Codec
Encoder of RequestMessage
and decoder of ResponseMessage
,
associated with a MIME type.
Type s
is the body of Response.
Codec | |
|
Request encoder
encodeBinaryWith :: Codec s -> RequestMessage -> ByteString Source #
Encode a RequestMessage
into a "binary" format of Gremlin
Server. The result includes the message "header" and the
"payload".
Request decoder
:: ByteString | |
-> Either String (Text, ByteString) | (mimeType, payload) |
Decode a message in the "binary" format. This is mainly for testing purposes.