-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Extras for working with websockets & JSON. -- -- Please see the README on GitHub at -- https://github.com/cardanosolutions/kupo/tree/master/server/modules/websockets-json @package websockets-json @version 1.0.0 -- | Extras for working with websockets & JSON. -- -- This module allows to write simple websocket clients following a -- request/response pattern over some JSON encoded data. module Network.WebSockets.Json -- | Send some JSON encoding through the given connection. sendJson :: forall m. MonadIO m => Connection -> Encoding -> m () -- | Synchronously receive some JSON-encoded bytes through the given -- connection. -- -- Throws MalformedOrUnexpectedResponseException upon failure. receiveJson :: forall m a. (MonadThrow m, MonadIO m) => Connection -> (Value -> Parser a) -> m a -- | An exception thrown when failing to decode a JSON payload. data MalformedOrUnexpectedResponseException MalformedOrUnexpectedResponse :: !ByteString -> !JSONPath -> !String -> MalformedOrUnexpectedResponseException -- | Actual bytes received from the websocket [bytesReceived] :: MalformedOrUnexpectedResponseException -> !ByteString -- | JSON path at which the decoding error occured [errorPath] :: MalformedOrUnexpectedResponseException -> !JSONPath -- | A explanation of what's going on. [hint] :: MalformedOrUnexpectedResponseException -> !String instance GHC.Show.Show Network.WebSockets.Json.MalformedOrUnexpectedResponseException instance GHC.Exception.Type.Exception Network.WebSockets.Json.MalformedOrUnexpectedResponseException