greskell-websocket-0.1.1.2: Haskell client for Gremlin Server using WebSocket serializer

MaintainerToshio Ito <debug.ito@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Network.Greskell.WebSocket.Codec

Contents

Description

 
Synopsis

Codec

data Codec s Source #

Encoder of RequestMessage and decoder of ResponseMessage, associated with a MIME type.

Type s is the body of Response.

Constructors

Codec 

Fields

Instances
Functor Codec Source # 
Instance details

Defined in Network.Greskell.WebSocket.Codec

Methods

fmap :: (a -> b) -> Codec a -> Codec b #

(<$) :: a -> Codec b -> Codec a #

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".

messageHeader Source #

Arguments

:: Text

MIME type

-> ByteString 

Make a request message header.

Request decoder

decodeBinary Source #

Arguments

:: ByteString 
-> Either String (Text, ByteString)

(mimeType, payload)

Decode a message in the "binary" format. This is mainly for testing purposes.