zio.http.endpoint

Members list

Concise view

Type members

Classlikes

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)

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.

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 to Input MiddlewareOutput: Example: A subset of Out[Output] that doesn't give access to Output Input: Example: Int Output: Example: User

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

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Self type
Endpoint[Input, Err, Output, Middleware]
object Endpoint

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class EndpointExecutor[+MI](client: Client, locator: EndpointLocator, middlewareInput: UIO[MI])

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.

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.

Attributes

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Attributes

Companion:
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type

An endpoint locator is responsible for locating endpoints.

An endpoint locator is responsible for locating endpoints.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
sealed trait EndpointMiddleware

A description of endpoint middleware, in terms of what the middleware requires from the request, and what it appends to the response.

A description of endpoint middleware, in terms of what the middleware requires from the request, and what it appends to the response.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object None.type
class Spec[In0, Err0, Out0]
Self type

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class EndpointNotFound(message: String, api: Endpoint[_, _, _, _]) extends Exception

Attributes

Graph
Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
final case class Invocation[I, E, O, M <: EndpointMiddleware](endpoint: Endpoint[I, E, O, M], input: I)

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.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
sealed trait Routes[-R, +E, M <: EndpointMiddleware]

Represents a collection of endpoints that all have handlers.

Represents a collection of endpoints that all have handlers.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Routes[R, E, M]
object Routes

Attributes

Companion:
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Routes.type

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.

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.

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion:
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type