package endpoint
- Alphabetic
- Public
- Protected
Type Members
- final case class Endpoint[Input, Err, Output, Middleware <: EndpointMiddleware](input: HttpCodec[RequestType, Input], output: HttpCodec[ResponseType, Output], error: HttpCodec[ResponseType, Err], doc: Doc, middleware: Middleware) extends Product with Serializable
An zio.http.endpoint.Endpoint represents an API endpoint for the HTTP protocol.
An zio.http.endpoint.Endpoint represents an API endpoint for the HTTP protocol. Every
API
has an input, which comes from a combination of the HTTP path, query string parameters, and headers, and an output, which is the data computed by the handler of the API.MiddlewareInput : Example: A subset of
HttpCodec[Input]
that doesn't give access toInput
MiddlewareOutput: Example: A subset ofOut[Output]
that doesn't give access toOutput
Input: Example: Int Output: Example: UserAs zio.http.endpoint.Endpoint is a purely declarative encoding of an endpoint, it is possible to use this model to generate a zio.http.App (by supplying a handler for the endpoint), to generate OpenAPI documentation, to generate a type-safe Scala client for the endpoint, and possibly, to generate client libraries in other programming languages.
- final case class EndpointExecutor[+MI](client: Client, locator: EndpointLocator, middlewareInput: UIO[MI]) extends Product with Serializable
A zio.http.endpoint.EndpointExecutor is responsible for taking an endpoint invocation, and executing the invocation, returning the final result, or failing with a pre-defined RPC error.
- trait EndpointLocator extends AnyRef
An endpoint locator is responsible for locating endpoints.
- sealed trait EndpointMiddleware extends AnyRef
A description of endpoint middleware, in terms of what the middleware requires from the request, and what it appends to the response.
- final case class EndpointNotFound(message: String, api: Endpoint[_, _, _, _]) extends Exception with Product with Serializable
- final case class Invocation[I, E, O, M <: EndpointMiddleware](endpoint: Endpoint[I, E, O, M], input: I) extends Product with Serializable
An invocation represents a single invocation of an endpoint through provision of the input that the endpoint requires.
An invocation represents a single invocation of an endpoint through provision of the input that the endpoint requires.
Invocations are pure data. In order to be useful, you must execute an invocation with an EndpointExecutor.
- sealed trait Routes[-R, +E, M <: EndpointMiddleware] extends AnyRef
Represents a collection of endpoints that all have handlers.
- trait RoutesMiddleware[-R, S, +M <: EndpointMiddleware] extends AnyRef
A RoutesMiddleware defines the middleware implementation for a given EndpointMiddleware.
A RoutesMiddleware defines the middleware implementation for a given EndpointMiddleware. These middleware are defined by a pair of functions, referred to as _incoming interceptor_ and _outgoing interceptor_, which are applied to incoming requests and outgoing responses.
Value Members
- object Endpoint extends Serializable
- object EndpointExecutor extends Serializable
- object EndpointLocator
- object EndpointMiddleware
- object Routes
- object RoutesMiddleware