Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
This module implments the HTTP message transport backend for the Network
monad.
Synopsis
- type API = "send" :> (Capture "from" LocTm :> (ReqBody '[PlainText] String :> PostNoContent))
- newtype HttpConfig = HttpConfig {}
- type Host = String
- type Port = Int
- mkHttpConfig :: [(LocTm, (Host, Port))] -> HttpConfig
- locs :: HttpConfig -> [LocTm]
- type RecvChans = HashMap LocTm (Chan String)
- mkRecvChans :: HttpConfig -> IO RecvChans
- runNetworkHttp :: MonadIO m => HttpConfig -> LocTm -> Network m a -> m a
Servant API
type API = "send" :> (Capture "from" LocTm :> (ReqBody '[PlainText] String :> PostNoContent)) Source #
Http configuration
newtype HttpConfig Source #
The HTTP backend configuration specifies how locations are mapped to network hosts and ports.
Instances
Backend HttpConfig Source # | |
Defined in Choreography.Network.Http runNetwork :: MonadIO m => HttpConfig -> LocTm -> Network m a -> m a Source # |
mkHttpConfig :: [(LocTm, (Host, Port))] -> HttpConfig Source #
Create a HTTP backend configuration from a association list that maps locations to network hosts and ports.
locs :: HttpConfig -> [LocTm] Source #
Receiving channels
mkRecvChans :: HttpConfig -> IO RecvChans Source #
HTTP backend
runNetworkHttp :: MonadIO m => HttpConfig -> LocTm -> Network m a -> m a Source #