Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Eved api m | api -> m
- data a :<|> b = a :<|> b
- (.</>) :: (Applicative f, Eved api m) => (f (api a) -> f (api b)) -> f (api a) -> f (api b)
- (.<|>) :: (Eved api m, Applicative f) => f (api a) -> f (api b) -> f (api (a :<|> b))
- lit :: (Eved api m, Applicative f) => Text -> f (api a) -> f (api a)
- capture :: (Eved api m, Applicative f) => Text -> f (UrlElement a) -> f (api b) -> f (api (a -> b))
- reqBody :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api b) -> f (api (a -> b))
- queryParam :: (Eved api m, Applicative f) => Text -> f (QueryParam a) -> f (api b) -> f (api (a -> b))
- verb :: (Eved api m, Applicative f) => StdMethod -> Status -> NonEmpty (f (ContentType a)) -> f (api (m a))
- get :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a))
- post :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a))
- put :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a))
- patch :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a))
- delete :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a))
- runClientIO :: ClientM a -> IO a
- runClient :: (MonadIO m, MonadReader env m, HasHttpManager env) => ClientM a -> m a
- noContext :: Eved api m => Identity (api a) -> api a
- withContext :: Eved api m => ctx -> (ctx -> api a) -> api a
- data ClientM a
- data EvedServerT m a
- server :: (forall a. m a -> IO a) -> a -> EvedServerT m a -> Application
Documentation
class Eved api m | api -> m Source #
Instances
(.</>) :: (Applicative f, Eved api m) => (f (api a) -> f (api b)) -> f (api a) -> f (api b) infixr 5 Source #
(.<|>) :: (Eved api m, Applicative f) => f (api a) -> f (api b) -> f (api (a :<|> b)) Source #
Combine two sub-api's by trying the left api first and then the right api second.
lit :: (Eved api m, Applicative f) => Text -> f (api a) -> f (api a) Source #
Add a Literal string to the path of the api
capture :: (Eved api m, Applicative f) => Text -> f (UrlElement a) -> f (api b) -> f (api (a -> b)) Source #
Add a url capture with a given name and UrlElement decoder/encoder
reqBody :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api b) -> f (api (a -> b)) Source #
Add a request body parser for the given content types The Content-Type header will be examined to assist in content negotiation.
queryParam :: (Eved api m, Applicative f) => Text -> f (QueryParam a) -> f (api b) -> f (api (a -> b)) Source #
A single query param that is required to exist. If the argument is not required use QP.maybe
verb :: (Eved api m, Applicative f) => StdMethod -> Status -> NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
The leaf node of most routes, this will specify the HTTP Verb and Status along with a list of ContentType encoder/decoders. The Allow header in the request will be examined to determine a suitable response Content-Type
get :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
HTTP GET -- see verb for more info
post :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
HTTP POST -- see verb for more info
put :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
HTTP PUT -- see verb for more info
patch :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
HTTP PATCH -- see verb for more info
delete :: (Eved api m, Applicative f) => NonEmpty (f (ContentType a)) -> f (api (m a)) Source #
HTTP DELETE -- see verb for more info
runClientIO :: ClientM a -> IO a Source #
runClient :: (MonadIO m, MonadReader env m, HasHttpManager env) => ClientM a -> m a Source #
noContext :: Eved api m => Identity (api a) -> api a Source #
Unwrap an api that requires no context. If none of the combinators that were used required any context use this function to unwrap the api
withContext :: Eved api m => ctx -> (ctx -> api a) -> api a Source #
Instances
Eved EvedClient ClientM Source # | |
Defined in Web.Eved.Client (.<|>) :: EvedClient a -> EvedClient b -> EvedClient (a :<|> b) Source # lit :: Text -> EvedClient a -> EvedClient a Source # capture :: Text -> UrlElement a -> EvedClient b -> EvedClient (a -> b) Source # reqBody :: NonEmpty (ContentType a) -> EvedClient b -> EvedClient (a -> b) Source # queryParam :: Text -> QueryParam a -> EvedClient b -> EvedClient (a -> b) Source # header :: Text -> Header a -> EvedClient b -> EvedClient (a -> b) Source # verb :: StdMethod -> Status -> NonEmpty (ContentType a) -> EvedClient (ClientM a) Source # |
data EvedServerT m a Source #
Instances
EvedAuth (EvedServerT m) Source # | |
Defined in Web.Eved.Auth auth_ :: NonEmpty (AuthScheme a) -> EvedServerT m b -> EvedServerT m (a -> b) Source # | |
Eved (EvedServerT m) m Source # | |
Defined in Web.Eved.Server (.<|>) :: EvedServerT m a -> EvedServerT m b -> EvedServerT m (a :<|> b) Source # lit :: Text -> EvedServerT m a -> EvedServerT m a Source # capture :: Text -> UrlElement a -> EvedServerT m b -> EvedServerT m (a -> b) Source # reqBody :: NonEmpty (ContentType a) -> EvedServerT m b -> EvedServerT m (a -> b) Source # queryParam :: Text -> QueryParam a -> EvedServerT m b -> EvedServerT m (a -> b) Source # header :: Text -> Header a -> EvedServerT m b -> EvedServerT m (a -> b) Source # verb :: StdMethod -> Status -> NonEmpty (ContentType a) -> EvedServerT m (m a) Source # |
server :: (forall a. m a -> IO a) -> a -> EvedServerT m a -> Application Source #