1 module JsonRpc ( JsonRpcRequest(..)
2 , JsonRpcNotification(..)
6 import Data.ByteString (ByteString)
7 import Control.Applicative ((<$>), (<*>), empty)
10 data JsonRpcRequest = JsonRpcRequest { jrpcReqMethod :: ByteString
11 , jrpcReqParams :: [ByteString]
12 , jrpcReqId :: ByteString
15 data JsonRpcNotification = JsonRpcNotification { jrpcNtfMethod :: ByteString
16 , jrpcNtfParams :: [ByteString]
19 data JsonRpcError = JsonRpcError { jrpcErrCode :: Int
20 , jrpcErrMessage :: ByteString
21 , jrpcErrData :: Maybe Value
24 data JsonRpcResponse = JsonRpcResponse { jrpcRspResult :: Maybe Value
25 , jrpcRspError :: JsonRpcError
26 , jrpcRspId :: ByteString