zio.http.endpoint

Members list

Packages

Type members

Classlikes

final case class Endpoint[PathInput, Input, Err, Output, Middleware <: EndpointMiddleware](route: RoutePattern[PathInput], 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 route, 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 route, 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.Route (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
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
Endpoint[PathInput, Input, Err, Output, Middleware]
object Endpoint

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Endpoint.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
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
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
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
trait
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
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object None.type
class Spec[In0, Err0, Out0]
Self type

Attributes

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

Attributes

Supertypes
trait Product
trait Equals
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
final case class Invocation[P, I, E, O, M <: EndpointMiddleware](endpoint: Endpoint[P, 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

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all