Packages

package server

Interpreters producing an http4s server

Source
package.scala
Linear Supertypes
Content Hierarchy

Type Members

  1. trait Assets extends algebra.Assets with EndpointsWithCustomErrors
  2. trait BasicAuthentication extends EndpointsWithCustomErrors with algebra.BasicAuthentication

  3. trait BuiltInErrors extends algebra.BuiltInErrors

  4. trait ChunkedEntities extends algebra.ChunkedEntities with EndpointsWithCustomErrors
  5. trait ChunkedJsonEntities extends algebra.ChunkedJsonEntities with ChunkedEntities with JsonEntitiesFromCodecs
  6. class Endpoints[F[_]] extends algebra.Endpoints with EndpointsWithCustomErrors with BuiltInErrors

    Interpreter for algebra.Endpoints based on http4s.

    Interpreter for algebra.Endpoints based on http4s. It uses algebra.BuiltInErrors to model client and server errors.

    Consider the following endpoint definition:

    trait MyEndpoints extends algebra.Endpoints with algebra.JsonEntitiesFromSchemas {
      val inc = endpoint(get(path / "inc" /? qs[Int]("x")), ok(jsonResponse[Int]))
    }

    You can get an http4s service for it as follow:

    object MyService
      extends endpoints.http4s.server.Endpoints[IO]
        with endpoints.http4s.server.JsonEntitiesFromSchemas
        with MyEndpoints {
    
      val service: org.http4s.HttpRoutes[IO] = HttpRoutes.of(
        routesFromEndpoints(
          inc.implementedBy(x => x + 1)
        )
      )
    }
    F

    Effect type

  7. trait EndpointsWithCustomErrors extends algebra.EndpointsWithCustomErrors with Methods with Urls

    Interpreter for algebra.EndpointsWithCustomErrors based on http4s.

  8. trait JsonEntitiesFromCodecs extends algebra.JsonEntitiesFromCodecs with EndpointsWithCustomErrors

    Interpreter for algebra.JsonEntitiesFromCodecs that decodes JSON requests and encodes JSON responses.

  9. trait JsonEntitiesFromEncodersAndDecoders extends JsonEntities with EndpointsWithCustomErrors

    Interpreter for endpoints4s.algebra.JsonEntities that decodes JSON entities with a endpoints4s.Decoder and encodes JSON entities with an endpoints4s.Encoder.

    Interpreter for endpoints4s.algebra.JsonEntities that decodes JSON entities with a endpoints4s.Decoder and encodes JSON entities with an endpoints4s.Encoder.

    The difference with JsonEntitiesFromCodecs is that you don’t need bidirectional codecs: you only need an encoder to build responses, or a decoder to decode requests.

    It is especially useful to encode OpenApi documents into JSON entities.

  10. trait JsonEntitiesFromSchemas extends algebra.JsonEntitiesFromSchemas with JsonEntitiesFromCodecs with JsonSchemas

    Interpreter for algebra.JsonEntitiesFromSchemas that decodes JSON requests and encodes JSON responses.

  11. trait Methods extends algebra.Methods

    algebra.Methods interpreter that decodes and encodes methods.

  12. trait MuxEndpoints extends algebra.MuxEndpoints with EndpointsWithCustomErrors

    Server interpreter of the algebra MuxEndpoints for http4s.

  13. trait MuxHandler[Req <: MuxRequest, Resp] extends AnyRef

    A function whose return type depends on the type of the given req.

    A function whose return type depends on the type of the given req.

    Req

    Request base type

    Resp

    Response base type

  14. trait MuxHandlerEffect[F[_], Req <: MuxRequest, Resp] extends AnyRef

    A function whose return type depends on the type of the given req.

    A function whose return type depends on the type of the given req.

    Req

    Request base type

    Resp

    Response base type

  15. trait StatusCodes extends algebra.StatusCodes

    algebra.StatusCodes interpreter that decodes and encodes methods.

  16. trait Urls extends algebra.Urls with StatusCodes

    algebra.Urls interpreter that decodes and encodes URLs.

Inherited from AnyRef

Inherited from Any

interpreters

Ungrouped