module Dormouse.Client.Class
( MonadDormouseClient(..)
, HasDormouseClientConfig(..)
, DormouseClientConfig(..)
) where
import Data.Word ( Word8 )
import Dormouse.Client.Payload ( RawRequestPayload(..) )
import Dormouse.Client.Types ( HttpRequest(..), HttpResponse(..) )
import Dormouse.Url ( IsUrl )
import Network.HTTP.Client ( Manager )
import Streamly ( SerialT )
newtype DormouseClientConfig = DormouseClientConfig { DormouseClientConfig -> Manager
clientManager :: Manager }
class HasDormouseClientConfig a where
getDormouseClientConfig :: a -> DormouseClientConfig
instance HasDormouseClientConfig DormouseClientConfig where
getDormouseClientConfig :: DormouseClientConfig -> DormouseClientConfig
getDormouseClientConfig = DormouseClientConfig -> DormouseClientConfig
forall a. a -> a
id
class Monad m => MonadDormouseClient m where
send :: IsUrl url => HttpRequest url method RawRequestPayload contentTag acceptTag -> (HttpResponse (SerialT IO Word8) -> IO (HttpResponse b)) -> m (HttpResponse b)