object * extends Endpoint[HNil]
- Alphabetic
- By Inheritance
- *
- Endpoint
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
:+:[B](that: Endpoint[B])(implicit a: Adjoin[:+:[B, :+:[HNil, CNil]]]): Endpoint[shapeless.ops.adjoin.Adjoin.Out]
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.
- Definition Classes
- Endpoint
-
final
def
::[B](other: Endpoint[B])(implicit pa: PairAdjoin[B, HNil]): Endpoint[internal.PairAdjoin.Out]
Composes this endpoint with the given Endpoint.
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
apply(input: Input): Result[HNil]
Runs this endpoint.
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
coproduct[B >: HNil](other: Endpoint[B]): Endpoint[B]
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 orthat
endpoints are succeed.Matching Rules
- 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
- Definition Classes
- Endpoint
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
handle[B >: HNil](pf: PartialFunction[Throwable, Output[B]]): Endpoint[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.
- Definition Classes
- Endpoint
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
item: RequestItem
Request item (part) that's this endpoint work with.
Request item (part) that's this endpoint work with.
- Definition Classes
- Endpoint
-
final
def
liftToTry: Endpoint[Try[HNil]]
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.
- Definition Classes
- Endpoint
-
final
def
map[B](fn: (HNil) ⇒ B): Endpoint[B]
Maps this endpoint to the given function
A => B
.Maps this endpoint to the given function
A => B
.- Definition Classes
- Endpoint
-
final
def
mapAsync[B](fn: (HNil) ⇒ Future[B]): Endpoint[B]
Maps this endpoint to the given function
A => Future[B]
.Maps this endpoint to the given function
A => Future[B]
.- Definition Classes
- Endpoint
-
final
def
mapOutput[B](fn: (HNil) ⇒ Output[B]): Endpoint[B]
Maps this endpoint to the given function
A => Output[B]
.Maps this endpoint to the given function
A => Output[B]
.- Definition Classes
- Endpoint
-
final
def
mapOutputAsync[B](fn: (HNil) ⇒ Future[Output[B]]): Endpoint[B]
Maps this endpoint to the given function
A => Future[Output[B]]
.Maps this endpoint to the given function
A => Future[Output[B]]
.- Definition Classes
- Endpoint
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
product[B](other: Endpoint[B]): Endpoint[(HNil, 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 ordinaryException
) observed.- Definition Classes
- Endpoint
-
final
def
productWith[B, O](other: Endpoint[B])(p: (HNil, B) ⇒ O): Endpoint[O]
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.- Definition Classes
- Endpoint
-
final
def
rescue[B >: HNil](pf: PartialFunction[Throwable, Future[Output[B]]]): Endpoint[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.
- Definition Classes
- Endpoint
-
final
def
should(rule: ValidationRule[HNil]): Endpoint[HNil]
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.- rule
the predefined ValidationRule that will return true if the data is valid
- returns
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with an Error.NotValid error.
- Definition Classes
- Endpoint
-
final
def
should(rule: String)(predicate: (HNil) ⇒ Boolean): Endpoint[HNil]
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.- rule
text describing the rule being validated
- predicate
returns true if the data is valid
- returns
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with an Error.NotValid error.
- Definition Classes
- Endpoint
-
final
def
shouldNot(rule: ValidationRule[HNil]): Endpoint[HNil]
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.- rule
the predefined ValidationRule that will return false if the data is valid
- returns
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with a Error.NotValid error.
- Definition Classes
- Endpoint
-
final
def
shouldNot(rule: String)(predicate: (HNil) ⇒ Boolean): Endpoint[HNil]
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.- rule
text describing the rule being validated
- predicate
returns false if the data is valid
- returns
an endpoint that will return the value of this reader if it is valid. Otherwise the future fails with a Error.NotValid error.
- Definition Classes
- Endpoint
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
final
def
toService(implicit tr: ToResponse.Aux[HNil, Json], tre: ToResponse.Aux[Exception, Json]): Service[Request, Response]
Converts this endpoint to a Finagle service
Request => Future[Response]
that serves JSON. -
final
def
toServiceAs[CT <: String](implicit tr: ToResponse.Aux[HNil, CT], tre: ToResponse.Aux[Exception, CT]): Service[Request, Response]
Converts this endpoint to a Finagle service
Request => Future[Response]
that serves custom content-typeCT
. -
final
def
toString(): String
- Definition Classes
- * → AnyRef → Any
-
final
def
transform[B](fn: (Future[Output[HNil]]) ⇒ Future[Output[B]]): Endpoint[B]
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))
- Definition Classes
- Endpoint
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
final
def
withToString(ts: ⇒ String): Endpoint[HNil]
Overrides the
toString
method on this endpoint.Overrides the
toString
method on this endpoint.- Definition Classes
- Endpoint
This is the API documentation for finch
Finch is a thin layer of purely functional basic blocks atop of [Finagle][finagle] for building composable HTTP APIs. Its mission is to provide the developers simple and robust HTTP primitives being as close as possible to the bare metal Finagle API.
Finch uses multi-project structure and contains of the following _modules_:
Please refer to the documentation for a more detailed introduction to the library.