serv-0.1.0.0: Dependently typed API server framework

Safe HaskellNone
LanguageHaskell2010

Serv.Internal.Server.Context

Synopsis

Documentation

corsHeaders :: (HeadersExpectedOf methods, HeadersReturnedBy methods, VerbsOf methods) => Proxy methods -> Bool -> Context -> Maybe [Header] Source #

takeAllSegments :: Context -> (Context, [Text]) Source #

Pop all remaining segments off the context

takeSegment :: Context -> (Context, Maybe Text) Source #

Pop a segment off the URI and produce a new context for "beyond" that segment

stepContext :: Context -> Context Source #

Move the context down the URI segment listing one step if possible.

pullHeaderRaw :: HeaderName -> Context -> (Context, Maybe ByteString) Source #

Pull a Header raw from the context, updating it to note that we looked

examineHeader :: HeaderDecode n a => Proxy n -> Context -> (Context, Either String a) Source #

Pull a header value from the context, updating it to note that we looked

examineHeaderFast :: HeaderDecode n a => Proxy n -> Context -> Maybe a Source #

Sort of like examineHeader but used for when we just want the value and don't care about updating the context or worrying about distinguishing between decoding failure and outright not being there at all!

expectHeader :: ReflectName n => Proxy n -> Text -> Context -> (Context, Bool) Source #

Match a header value in the context, updating it to show that we looked

safeHead :: [a] -> Maybe a Source #