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.
Composes this endpoint with the given other
endpoint.
Composes this endpoint with the given other
endpoint. The resulting endpoint will succeed
only if both this and that
endpoints succeed.
Runs this endpoint.
Runs this endpoint.
Maps this endpoint to either A => Output[B]
or A => Output[Future[B]]
.
Maps this endpoint to either A => Output[B]
or A => Output[Future[B]]
.
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 an empty Option
representing failure.
Lifts this endpoint into one that always succeeds, with an empty Option
representing failure.
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]]
.
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 JSON.
Converts this endpoint to a Finagle service Request => Future[Response]
that serves custom
content-type CT
.
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))
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.
Composes this endpoint with the given Endpoint.
Composes this endpoint with the given Endpoint.
Maps this endpoint to Endpoint[A => B]
.
Maps this endpoint to Endpoint[A => B]
.
(Since version 0.11.0) Use product or Applicative[Endpoint].ap
A matching Endpoint that reads a long value from the current path segment.