Composes this endpoint with another in such a way that coproducts are flattened.
Composes this endpoint with another in such a way that coproducts are flattened.
Composes this endpoint with the given Endpoint.
Runs this endpoint.
Sequentially composes this endpoint with the given other
endpoint.
Sequentially composes this endpoint with the given other
endpoint. The resulting endpoint
will succeed if either this or that
endpoints are succeed.
- if both endpoints match, the result with a shorter remainder (in terms of consumed route) is picked - if both endpoints don't match, the more specific result (explaining the reason for not matching) is picked
Recovers from any exception occurred in this endpoint by creating a new endpoint that will handle any matching throwable from the underlying future.
Recovers from any exception occurred in this endpoint by creating a new endpoint that will handle any matching throwable from the underlying future.
Request item (part) that's this endpoint work with.
Request item (part) that's this endpoint work with.
Lifts this endpoint into one that always succeeds, with Try representing both success and failure cases.
Lifts this endpoint into one that always succeeds, with Try representing both success and failure cases.
Maps this endpoint to the given function A => B
.
Maps this endpoint to the given function A => B
.
Maps this endpoint to the given function A => Future[B]
.
Maps this endpoint to the given function A => Future[B]
.
Maps this endpoint to the given function A => Output[B]
.
Maps this endpoint to the given function A => Output[B]
.
Maps this endpoint to the given function A => Future[Output[B]]
.
Maps this endpoint to the given function A => Future[Output[B]]
.
Returns a product of this and other
endpoint.
Returns a product of this and other
endpoint. The resulting endpoint returns a tuple
of both values.
This combinator is an important piece for Finch's error accumulation. In its current form,
product
will accumulate Finch's own errors (i.e., Errors) into Errors) and
will fail-fast with the first non-Finch error (just ordinary Exception
) observed.
Returns a product of this and other
endpoint.
Returns a product of this and other
endpoint. The resulting endpoint returns a value of
resulting type for product function.
Recovers from any exception occurred in this endpoint by creating a new endpoint that will handle any matching throwable from the underlying future.
Recovers from any exception occurred in this endpoint by creating a new endpoint that will handle any matching throwable from the underlying future.
Validates the result of this endpoint using a predefined rule
.
Validates the result of this endpoint using a predefined rule
. This method allows for rules
to be reused across multiple endpoints.
the predefined ValidationRule that will return true if the data is valid
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with an Error.NotValid error.
Validates the result of this endpoint using a predicate
.
Validates the result of this endpoint using a predicate
. The rule is used for error
reporting.
text describing the rule being validated
returns true if the data is valid
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with an Error.NotValid error.
Validates the result of this endpoint using a predefined rule
.
Validates the result of this endpoint using a predefined rule
. This method allows for rules
to be reused across multiple endpoints.
the predefined ValidationRule that will return false if the data is valid
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with a Error.NotValid error.
Validates the result of this endpoint using a predicate
.
Validates the result of this endpoint using a predicate
. The rule is used for error reporting.
text describing the rule being validated
returns false if the data is valid
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with a Error.NotValid error.
Converts this endpoint to a Finagle service Request => Future[Response]
that serves JSON.
Converts this endpoint to a Finagle service Request => Future[Response]
that serves custom
content-type CT
.
Transforms this endpoint to the given function Future[Output[A]] => Future[Output[B]]
.
Transforms this endpoint to the given function Future[Output[A]] => Future[Output[B]]
.
Might be useful to perform some extra action on the underlying Future
. For example, time
the latency of the given endpoint.
import io.finch._ import com.twitter.finagle.stats._ def time[A](stat: Stat, e: Endpoint[A]): Endpoint[A] = e.transform(f => Stat.timeFuture(s)(f))
Overrides the toString
method on this endpoint.
Overrides the toString
method on this endpoint.
An Endpoint that skips all path segments.