abstract class ServerEndpoint[-R, F[_]] extends EndpointInfoOps[R] with EndpointMetaOps
An Endpoint together with functions implementing the endpoint's security and main logic.
- R
Requirements: The capabilities that are required by this endpoint's inputs/outputs.
Any
, if no requirements.- F
The effect type constructor used in the provided server logic.
- Self Type
- ServerEndpoint[R, F]
- Alphabetic
- By Inheritance
- ServerEndpoint
- EndpointMetaOps
- EndpointInfoOps
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new ServerEndpoint()
Type Members
- abstract type ERROR_OUTPUT
Error output parameter types (abbreviated as
E
). - abstract type INPUT
Input parameter types (abbreviated as
I
). - abstract type OUTPUT
Output parameter types (abbreviated as
O
). - abstract type PRINCIPAL
The type of the value returned by the security logic, e.g.
The type of the value returned by the security logic, e.g. a user (abbreviated as
U
). - abstract type SECURITY_INPUT
Security input parameter types (abbreviated as
A
). - type ThisType[-_R] = ServerEndpoint[_R, F] { ... /* 5 definitions in type refinement */ }
- Definition Classes
- ServerEndpoint → EndpointInfoOps
Abstract Value Members
- abstract def endpoint: Endpoint[SECURITY_INPUT, INPUT, ERROR_OUTPUT, OUTPUT, R]
- abstract def logic: (MonadError[F]) => (PRINCIPAL) => (INPUT) => F[Either[ERROR_OUTPUT, OUTPUT]]
- abstract def securityLogic: (MonadError[F]) => (SECURITY_INPUT) => F[Either[ERROR_OUTPUT, PRINCIPAL]]
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def attribute[T](k: AttributeKey[T], v: T): ThisType[R]
- Definition Classes
- EndpointInfoOps
- def attribute[T](k: AttributeKey[T]): Option[T]
- Definition Classes
- EndpointInfoOps
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def deprecated(): ThisType[R]
- Definition Classes
- EndpointInfoOps
- def description(d: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def errorOutput: EndpointOutput[ERROR_OUTPUT]
- Definition Classes
- ServerEndpoint → EndpointMetaOps
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def info: EndpointInfo
- Definition Classes
- ServerEndpoint → EndpointMetaOps → EndpointInfoOps
- def info(i: EndpointInfo): ThisType[R]
- Definition Classes
- EndpointInfoOps
- def input: EndpointInput[INPUT]
- Definition Classes
- ServerEndpoint → EndpointMetaOps
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def method: Option[Method]
The method defined in a fixed method input in this endpoint, if any (using e.g.
The method defined in a fixed method input in this endpoint, if any (using e.g. EndpointInputsOps.get or EndpointInputsOps.post).
- Definition Classes
- EndpointMetaOps
- def name(n: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def output: EndpointOutput[OUTPUT]
- Definition Classes
- ServerEndpoint → EndpointMetaOps
- def prependSecurity[A2, E2](additionalSecurityInput: EndpointInput[A2], securityErrorOutput: EndpointOutput[E2])(additionalSecurityLogic: (A2) => F[Either[E2, Unit]])(implicit arg0: ClassTag[E2], arg1: ErasureSameAsType[E2]): ServerEndpoint[R, F]
Prepends additional security logic to this endpoint.
Prepends additional security logic to this endpoint. This is useful when adding security to file/resource-serving endpoints. The additional security logic should return a
Right(())
to indicate success, or aLeft(E2)
to indicate failure; in this case, the given error output will be used to create the response.The security inputs will become a tuple, containing first
additionalSecurityInput
combined with the currentendpoint.securityInput
.The error output will consist of two variants: either the
securityErrorOutput
(the ClassTag requirement forE2
is used to create the oneOfVariant). In the absence of sum types, the resulting errors are typed asAny
.The security logic is modified so that first
additionalSecurityLogic
is run, followed by the security logic defined so far.The type of the value returned by the combined security logic, or the regular logic remains unchanged.
- A2
Type of the additional security input.
- E2
Type of the error output for the security logic.
- def prependSecurityIn(additionalInput: EndpointInput[Unit]): ServerEndpoint[R, F]
Prepends an additional input to this endpoint.
Prepends an additional input to this endpoint. This is useful when adding a context path to endpoints, e.g.
serverEndpoint.prependSecurityIn("api" / "v1")
.The given input can't map to any values in the request, hence its type is
EndpointInput[Unit]
; it has to be "netural" so that the server logic function can remain unchanged.The input is prepended to the security inputs, so that it is decoded before any other path-related inputs (either security or regular).
- def prependSecurityPure[A2, E2](additionalSecurityInput: EndpointInput[A2], securityErrorOutput: EndpointOutput[E2])(additionalSecurityLogic: (A2) => Either[E2, Unit])(implicit arg0: ClassTag[E2], arg1: ErasureSameAsType[E2]): ServerEndpoint[R, F]
See prependSecurity.
- def securityInput: EndpointInput[SECURITY_INPUT]
- Definition Classes
- ServerEndpoint → EndpointMetaOps
- def show: String
Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.).
Basic information about the endpoint, excluding mapping information, with inputs sorted (first the method, then path, etc.). E.g.:
POST /books /add {header Authorization} {body as application/json (UTF-8)} -> {body as text/plain (UTF-8)}/-
- Definition Classes
- EndpointMetaOps
- def showDetail: String
Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information.
Detailed description of the endpoint, with inputs/outputs represented in the same order as originally defined, including mapping information. E.g.:
Endpoint(securityin: -, in: /books POST /add {body as application/json (UTF-8)} {header Authorization}, errout: {body as text/plain (UTF-8)}, out: -)
- Definition Classes
- EndpointMetaOps
- def showPathTemplate(showPathParam: (Int, PathCapture[_]) => String = (index, pc) => pc.name.map(name => s"{$name}").getOrElse(s"{param$index}"), showQueryParam: Option[(Int, Query[_]) => String] = Some((_, q) => s"${q.name}={${q.name}}"), includeAuth: Boolean = true, showNoPathAs: String = "*", showPathsAs: Option[String] = Some("*"), showQueryParamsAs: Option[String] = Some("*")): String
Shows endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g.
Shows endpoint path, by default all parametrised path and query components are replaced by {param_name} or {paramN}, e.g. for
endpoint.in("p1" / path[String] / query[String]("par2"))
returns
/p1/{param1}?par2={par2}
- includeAuth
Should authentication inputs be included in the result.
- showNoPathAs
How to show the path if the endpoint does not define any path inputs.
- showPathsAs
How to show Tapir.paths inputs (if at all), which capture multiple paths segments
- showQueryParamsAs
How to show Tapir.queryParams inputs (if at all), which capture multiple query parameters
- Definition Classes
- EndpointMetaOps
- def showRaw: String
Equivalent to
.toString
, shows the whole case class structure.Equivalent to
.toString
, shows the whole case class structure.- Definition Classes
- EndpointMetaOps
- def showShort: String
Shortened information about the endpoint.
Shortened information about the endpoint. If the endpoint is named, returns the name, e.g.
[my endpoint]
. Otherwise, returns the string representation of the method (if any) and path, e.g.POST /books/add
- Definition Classes
- EndpointMetaOps
- def showType: String
- Attributes
- protected
- Definition Classes
- ServerEndpoint → EndpointMetaOps
- def summary(s: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tag(t: String): ThisType[R]
- Definition Classes
- EndpointInfoOps
- def tags(ts: List[String]): ThisType[R]
- Definition Classes
- EndpointInfoOps
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated