package server
- Alphabetic
- By Inheritance
- server
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- case class DecodeFailureContext(input: EndpointInput[_], failure: Failure) extends Product with Serializable
- type DecodeFailureHandler = (DecodeFailureContext) => DecodeFailureHandling
Given the context in which a decode failure occurred (the request, the input and the failure), returns the action that should be taken.
Given the context in which a decode failure occurred (the request, the input and the failure), returns the action that should be taken.
See also DecodeFailureHandling and DefaultDecodeFailureHandler.
- trait DecodeFailureHandling extends AnyRef
Describes the action to take, when decoding an input of a request fails.
Describes the action to take, when decoding an input of a request fails. Should another endpoint be tried, or should a response be sent.
- case class DefaultDecodeFailureHandler(respondWithStatusCode: (DecodeFailureContext) => Option[StatusCode], response: (StatusCode, String) => DecodeFailureHandling, failureMessage: (DecodeFailureContext) => String) extends DecodeFailureHandler with Product with Serializable
Create a decode failure handler, which: - decides whether the given decode failure should lead to a response (and if so, with which status code), or return a DecodeFailureHandling.noMatch, using
respondWithStatusCode
- creates decode failure messages usingfailureMessage
- creates the response usingresponse
- case class LogRequestHandling[T](doLogWhenHandled: (String, Option[Throwable]) => T, doLogAllDecodeFailures: (String, Option[Throwable]) => T, doLogLogicExceptions: (String, Throwable) => T, noLog: T, logWhenHandled: Boolean = true, logAllDecodeFailures: Boolean = false, logLogicExceptions: Boolean = true) extends Product with Serializable
Callbacks to log how a request was handled.
Callbacks to log how a request was handled.
- T
Interpreter-specific value representing the log action.
- abstract class PartialServerEndpoint[U, I, E, O, -R, F[_]] extends EndpointInputsOps[I, E, O, R] with EndpointOutputsOps[I, E, O, R] with EndpointInfoOps[I, E, O, R] with EndpointMetaOps[I, E, O, R]
An endpoint, with some of the server logic already provided, and some left unspecified.
An endpoint, with some of the server logic already provided, and some left unspecified. See Endpoint.serverLogicForCurrent.
The part of the server logic which is provided transforms some inputs either to an error of type
E
, or value of typeU
.The part of the server logic which is not provided, transforms a tuple:
(U, I)
either into an error, or a value of typeO
.Inputs/outputs can be added to partial endpoints as to regular endpoints, however the shape of the error outputs is fixed and cannot be changed.
- U
Type of partially transformed input.
- I
Input parameter types.
- E
Error output parameter types.
- O
Output parameter types.
- R
The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements.- F
The effect type used in the provided partial server logic.
- case class ServerEndpoint[I, E, O, -R, F[_]](endpoint: Endpoint[I, E, O, R], logic: (MonadError[F]) => (I) => F[Either[E, O]]) extends EndpointInfoOps[I, E, O, R] with EndpointMetaOps[I, E, O, R] with Product with Serializable
- I
Input parameter types.
- E
Error output parameter types.
- O
Output parameter types.
- R
The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements.- F
The effect type used in the provided server logic.
- abstract class ServerEndpointInParts[U, IR, I, E, O, -R, F[_]] extends EndpointInfoOps[I, E, O, R] with EndpointMetaOps[I, E, O, R]
An endpoint description together with partial server logic.
An endpoint description together with partial server logic. See Endpoint.serverLogicPart.
The part of the server logic which is provided transforms some inputs either to an error of type
E
, or value of typeU
.The part of the server logic which is not provided, transforms a tuple:
(U, R)
either into an error of typeE
, or a value of typeO
.- U
The type of the value returned by the partial server logic.
- IR
Remaining input parameter types, for which logic has yet to be provided.
- I
Entire input parameter types.
I = T + R
, whereT
is the part of the input consumed by the partial logic, and converted toU
.- E
Error output parameter types.
- O
Output parameter types.
- R
The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements.- F
The effect type used in the provided server logic.
Value Members
- object DecodeFailureHandling
- object ServerDefaults