package server
Type Members
- trait Assets extends algebra.Assets with EndpointsWithCustomErrors
- trait BasicAuthentication extends EndpointsWithCustomErrors with algebra.BasicAuthentication
- trait BuiltInErrors extends algebra.BuiltInErrors
- trait ChunkedEntities extends algebra.ChunkedEntities with EndpointsWithCustomErrors
- trait ChunkedJsonEntities extends algebra.ChunkedJsonEntities with ChunkedEntities with JsonEntitiesFromCodecs
- 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
- trait EndpointsWithCustomErrors extends algebra.EndpointsWithCustomErrors with Methods with Urls
Interpreter for algebra.EndpointsWithCustomErrors based on http4s.
- trait JsonEntitiesFromCodecs extends algebra.JsonEntitiesFromCodecs with EndpointsWithCustomErrors
Interpreter for algebra.JsonEntitiesFromCodecs that decodes JSON requests and encodes JSON responses.
- 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. - trait JsonEntitiesFromSchemas extends algebra.JsonEntitiesFromSchemas with JsonEntitiesFromCodecs with JsonSchemas
Interpreter for algebra.JsonEntitiesFromSchemas that decodes JSON requests and encodes JSON responses.
- trait Methods extends algebra.Methods
algebra.Methods interpreter that decodes and encodes methods.
- trait MuxEndpoints extends algebra.MuxEndpoints with EndpointsWithCustomErrors
Server interpreter of the algebra
MuxEndpoints
for http4s. - 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
- 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
- trait StatusCodes extends algebra.StatusCodes
algebra.StatusCodes interpreter that decodes and encodes methods.
- trait Urls extends algebra.Urls with StatusCodes
algebra.Urls interpreter that decodes and encodes URLs.