RoutesMiddleware

zio.http.endpoint.RoutesMiddleware
See theRoutesMiddleware companion object

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

Members list

Concise view

Type members

Types

final type E = Err
final type I = In
final type O = Out

Value members

Abstract methods

def incoming(input: I): ZIO[R, E, S]

The incoming interceptor is responsible for taking the input to the middleware, derived from the request according to the definition of the middleware, and either failing, or producing a state value, which will be passed with the outgoing interceptor.

The incoming interceptor is responsible for taking the input to the middleware, derived from the request according to the definition of the middleware, and either failing, or producing a state value, which will be passed with the outgoing interceptor.

Attributes

def outgoing(state: S): ZIO[R, E, O]

The outgoing interceptor is responsible for taking the state value produced by the incoming interceptor, and either failing, or producing an output value, which will be used to patch the response.

The outgoing interceptor is responsible for taking the state value produced by the incoming interceptor, and either failing, or producing an output value, which will be used to patch the response.

Attributes

Concrete methods

final def toHandlerAspect: Simple[R, Nothing]

Converts this RoutesMiddleware to a zio.http.HandlerAspect, which can be applied in straightforward fashion to any request handler or HTTP.

Converts this RoutesMiddleware to a zio.http.HandlerAspect, which can be applied in straightforward fashion to any request handler or HTTP.

Attributes

Abstract fields

val middleware: M