object HttpRoutes
- Alphabetic
- By Inheritance
- HttpRoutes
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
apply[F[_]](run: (Request[F]) ⇒ OptionT[F, Response[F]])(implicit arg0: Sync[F]): HttpRoutes[F]
Lifts a function into an HttpRoutes.
Lifts a function into an HttpRoutes. The application of
run
is suspended inF
to permit more efficient combination of routes viaSemigroupK
.- F
the effect of the HttpRoutes
- run
the function to lift
- returns
an HttpRoutes that wraps
run
-
def
empty[F[_]](implicit arg0: Applicative[F]): HttpRoutes[F]
An empty set of routes.
An empty set of routes. Always responds with
OptionT.none
.- F
the base effect of the HttpRoutes
-
def
liftF[F[_]](fr: OptionT[F, Response[F]]): HttpRoutes[F]
Lifts an effectful Response into an HttpRoutes.
Lifts an effectful Response into an HttpRoutes.
- F
the effect of the HttpRoutes
- fr
the effectful Response to lift
- returns
an HttpRoutes that always returns
fr
-
def
local[F[_]](f: (Request[F]) ⇒ Request[F])(fa: HttpRoutes[F])(implicit arg0: Sync[F]): HttpRoutes[F]
Transforms an HttpRoutes on its input.
Transforms an HttpRoutes on its input. The application of the transformed function is suspended in
F
to permit more efficient combination of routes viaSemigroupK
.- F
the base effect of the HttpRoutes
- f
a function to apply to the Request
- fa
the HttpRoutes to transform
- returns
An HttpRoutes whose input is transformed by
f
before being applied tofa
-
def
of[F[_]](pf: PartialFunction[Request[F], F[Response[F]]])(implicit F: Sync[F]): HttpRoutes[F]
Lifts a partial function into an HttpRoutes.
Lifts a partial function into an HttpRoutes. The application of the partial function is suspended in
F
to permit more efficient combination of routes viaSemigroupK
.- F
the base effect of the HttpRoutes
- pf
the partial function to lift
- returns
An HttpRoutes that returns some Response in an
OptionT[F, ?]
whereverpf
is defined, anOptionT.none
wherever it is not
-
def
pure[F[_]](r: Response[F])(implicit FO: Applicative[[β$0$]OptionT[F, β$0$]]): HttpRoutes[F]
Lifts a Response into an HttpRoutes.
Lifts a Response into an HttpRoutes.
- F
the base effect of the HttpRoutes
- r
the Response to lift
- returns
an HttpRoutes that always returns
r
in effectOptionT[F, ?]
-
def
strict[F[_]](pf: PartialFunction[Request[F], F[Response[F]]])(implicit arg0: Applicative[F]): HttpRoutes[F]
Lifts a partial function into an HttpRoutes.
Lifts a partial function into an HttpRoutes. The application of the partial function is not suspended in
F
, unlike of. This allows for less constraints when not combining many routes.- F
the base effect of the HttpRoutes
- pf
the partial function to lift
- returns
An HttpRoutes that returns some Response in an
OptionT[F, ?]
whereverpf
is defined, anOptionT.none
wherever it is not