Middlewares are essentially transformations that one can apply on any Http to produce a new one. They can modify requests and responses and also transform them into more concrete domain entities.
You can think of middlewares as a functions —
type Middleware[R, E, AIn, BIn, AOut, BOut] = Http[R, E, AIn, BIn] => Http[R, E, AOut, BOut]
The AIn
and BIn
type params represent the type params of the input Http.
The AOut
and BOut
type params represent the type params of the output
Http.
- Companion:
- object
Value members
Abstract methods
Concrete methods
Combines two middleware that don't modify the input and output types.
Combines two middleware that don't modify the input and output types.
Applies self but if it fails, applies other.
Applies self but if it fails, applies other.
Creates a new middleware that passes the output Http of the current middleware as the input to the provided middleware.
Creates a new middleware that passes the output Http of the current middleware as the input to the provided middleware.
Composes one middleware with another.
Composes one middleware with another.
Makes the middleware resolve with a constant Middleware
Makes the middleware resolve with a constant Middleware
Combines two middleware that operate on the same input and output types, into one.
Combines two middleware that operate on the same input and output types, into one.
Preprocesses the incoming value for the outgoing Http.
Preprocesses the incoming value for the outgoing Http.
Preprocesses the incoming value using a ZIO, for the outgoing Http.
Preprocesses the incoming value using a ZIO, for the outgoing Http.
Delays the production of Http output for the specified duration
Delays the production of Http output for the specified duration
Creates a new Middleware from another
Creates a new Middleware from another
Flattens an Middleware of a Middleware
Flattens an Middleware of a Middleware
Transforms the output type of the current middleware.
Transforms the output type of the current middleware.
Transforms the output type of the current middleware using effect function.
Transforms the output type of the current middleware using effect function.
Applies self but if it fails, applies other.
Applies self but if it fails, applies other.
Race between current and other, cancels other when execution of one completes
Race between current and other, cancels other when execution of one completes
Applies Middleware based only if the condition function evaluates to true
Applies Middleware based only if the condition function evaluates to true
Applies Middleware based only if the condition effectful function evaluates to true
Applies Middleware based only if the condition effectful function evaluates to true