Portability | UNIX |
---|---|
Stability | Stable |
Maintainer | alex.martin@help.com |
Safe Haskell | None |
- class EsbSend a where
- class EsbRecieve a where
- esbRecieve :: Socket -> a -> IO ()
- getSocket :: String -> Int -> IO Socket
- sendSocketData :: Socket -> ByteString -> IO ()
- readSocketDataRaw :: Socket -> IO [Char]
- readSocketData :: Socket -> IO ByteString
- esbInit :: Text -> [Text] -> String -> Int -> IO Socket
- esbListen :: Socket -> IO ByteString
- encode :: ToJSON a => a -> ByteString
- decode :: FromJSON a => ByteString -> Maybe a
- eitherDecode :: FromJSON a => ByteString -> Either String a
- logger :: String -> IO ()
- data Socket
- module System.Environment
Classes
The EsbSend
class determines how a message should be sent to the ESB.
The esbSend
method takes a socket and writes somekind of payload.
class EsbRecieve a whereSource
The EsbRecieve
class determines how a message from the ESB should be
recieved.
The esbRecieve
method takes a socket and reads somekind of payload.
EsbRecieve Message | The |
Raw Exported Functions
The getSocket
function takes a host and port and connects to and
returns the socket.
The sendSocketData
function accepts a socket and bytes, converts the
bytes to cleaned up JSON, and writes the JSON to the socket.
The readSocketDataRaw
function accepts a socket and grabs whatever
data might be in the latest message.
The readSocketData
function accepts a socket, reads and cleans up
any JSON for parsing, and returns the bytes of JSON.
ESB Functions
:: Text | Group name. |
-> [Text] | Subscriptions. |
-> String | Host address. |
-> Int | Host port. |
-> IO Socket | The socket connection. |
The esbInit
function initializes the socket connection and logs
into the ESB.
The esbListen
function performs all essential listening logic
for any ESB client.
Utility Functions
encode :: ToJSON a => a -> ByteString
eitherDecode :: FromJSON a => ByteString -> Either String a
The logger
function simply logs out in a consistent way. Will be
updated to be more robust.
Utility Types
module System.Environment