Packages

o

org.http4s

HttpRoutes

object HttpRoutes

Functions for creating HttpRoutes kleislis.

Source
HttpRoutes.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpRoutes
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. def apply[F[_]](run: (Request[F]) ⇒ OptionT[F, Response[F]])(implicit arg0: Monad[F]): HttpRoutes[F]

    Lifts a function into an HttpRoutes.

    Lifts a function into an HttpRoutes. The application of run is suspended in F to permit more efficient combination of routes via SemigroupK.

    F

    the effect of the HttpRoutes

    run

    the function to lift

    returns

    an HttpRoutes that wraps run

  2. 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

  3. 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

  4. def local[F[_]](f: (Request[F]) ⇒ Request[F])(fa: HttpRoutes[F])(implicit arg0: Monad[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 via SemigroupK.

    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 to fa

  5. def of[F[_]](pf: PartialFunction[Request[F], F[Response[F]]])(implicit arg0: Monad[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 via SemigroupK.

    F

    the base effect of the HttpRoutes - Defer suspends evaluation of routes, so only 1 section of routes is checked at a time.

    pf

    the partial function to lift

    returns

    An HttpRoutes that returns some Response in an OptionT[F, *] wherever pf is defined, an OptionT.none wherever it is not

  6. 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 effect OptionT[F, *]

  7. 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, *] wherever pf is defined, an OptionT.none wherever it is not