| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Network.Mattermost.Util
Synopsis
- data ConnectionType
- assertE :: Exception e => Bool -> e -> IO ()
- noteE :: Exception e => Maybe r -> e -> IO r
- hoistE :: Exception e => Either e r -> IO r
- (~=) :: String -> String -> Bool
- withConnection :: ConnectionData -> (MMConn -> IO a) -> IO a
- mkConnection :: ConnectionContext -> Hostname -> Port -> ConnectionType -> IO Connection
- connectionGetExact :: Connection -> Int -> IO ByteString
- buildPath :: ConnectionData -> Text -> IO Text
Documentation
data ConnectionType Source #
Constructors
| ConnectHTTPS Bool | Boolean is whether to require trusted certificate |
| ConnectHTTP | Make an insecure connection over HTTP |
Instances
| Read ConnectionType Source # | |
Defined in Network.Mattermost.Types.Internal Methods readsPrec :: Int -> ReadS ConnectionType # readList :: ReadS [ConnectionType] # | |
| Show ConnectionType Source # | |
Defined in Network.Mattermost.Types.Internal Methods showsPrec :: Int -> ConnectionType -> ShowS # show :: ConnectionType -> String # showList :: [ConnectionType] -> ShowS # | |
| Eq ConnectionType Source # | |
Defined in Network.Mattermost.Types.Internal Methods (==) :: ConnectionType -> ConnectionType -> Bool # (/=) :: ConnectionType -> ConnectionType -> Bool # | |
withConnection :: ConnectionData -> (MMConn -> IO a) -> IO a Source #
Creates a new connection to Hostname from an already initialized
ConnectionContext.
mkConnection :: ConnectionContext -> Hostname -> Port -> ConnectionType -> IO Connection Source #
Creates a connection from a ConnectionData value, returning it. It
is the user's responsibility to close this appropriately.
This function respects ALL_PROXY, HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables for controlling whether the resulting connection uses a proxy. However, note:
- Only SOCKS version 4 and 5 proxies are supported using socks4:// and socks5:// URIs, and
- No proxy authentication is supported.
connectionGetExact :: Connection -> Int -> IO ByteString Source #
Get exact count of bytes from a connection.
The size argument is the exact amount that must be returned to the user.
The call will wait until all data is available. Hence, it behaves like
hGet.
On end of input, connectionGetExact will throw an isEOFError
exception.
Taken from: https://github.com/vincenthz/hs-connection/issues/9