Packages

  • package root

    This is the API documentation for finch

    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_:

    • core - the core classes/functions
    • argonaut - the JSON API support for the [Argonaut][argonaut] library
    • jackson - the JSON API support for the [Jackson][jackson] library
    • json4s - the JSON API support for the [JSON4S][json4s] library
    • circe - the JSON API support for the [Circe][circe] library
    • playjson - The JSON API support for the [PlayJson][playjson] library
    • sprayjson - The JSON API support for the [SprayJson][sprayjson] library
    • test - the test support classes/functions
    • oauth2 - the OAuth2 support backed by the [finagle-oauth2][finagle-oauth2] library
    • see - SSE ([Server Sent Events][server-sent-events]) support in Finch

    Please refer to the documentation for a more detailed introduction to the library.

    Definition Classes
    root
  • package io
    Definition Classes
    root
  • package finch

    This is a root package of the Finch library, which provides an immutable layer of functions and types atop of Finagle for writing lightweight HTTP services.

    This is a root package of the Finch library, which provides an immutable layer of functions and types atop of Finagle for writing lightweight HTTP services.

    Definition Classes
    io
  • trait Endpoints extends Bodies with Paths with Headers with ParamAndParams with Cookies with FileUploadsAndAttributes

    A collection of Endpoint combinators.

    A collection of Endpoint combinators.

    Definition Classes
    finch
  • *
  • /
  • root

object root extends Endpoint[Request]

A root Endpoint that always matches and extracts the current request.

Source
Endpoints.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. root
  2. Endpoint
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def :+:[B](that: Endpoint[B])(implicit a: Adjoin[:+:[B, :+:[Request, 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
  4. final def ::[B](other: Endpoint[B])(implicit pa: PairAdjoin[B, Request]): Endpoint[internal.PairAdjoin.Out]

    Composes this endpoint with the given Endpoint.

    Composes this endpoint with the given Endpoint.

    Definition Classes
    Endpoint
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def apply(input: Input): Result[Request]

    Runs this endpoint.

    Runs this endpoint.

    Definition Classes
    rootEndpoint
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. final def coproduct[B >: Request](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 or that 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
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. final def handle[B >: Request](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
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def item: RequestItem

    Request item (part) that's this endpoint work with.

    Request item (part) that's this endpoint work with.

    Definition Classes
    Endpoint
  18. final def liftToTry: Endpoint[Try[Request]]

    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
  19. final def map[B](fn: (Request) ⇒ B): Endpoint[B]

    Maps this endpoint to the given function A => B.

    Maps this endpoint to the given function A => B.

    Definition Classes
    Endpoint
  20. final def mapAsync[B](fn: (Request) ⇒ 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
  21. final def mapOutput[B](fn: (Request) ⇒ 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
  22. final def mapOutputAsync[B](fn: (Request) ⇒ 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
  23. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  26. final def product[B](other: Endpoint[B]): Endpoint[(Request, 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.

    Definition Classes
    Endpoint
  27. final def productWith[B, O](other: Endpoint[B])(p: (Request, 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
  28. final def rescue[B >: Request](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
  29. final def should(rule: ValidationRule[Request]): Endpoint[Request]

    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
  30. final def should(rule: String)(predicate: (Request) ⇒ Boolean): Endpoint[Request]

    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
  31. final def shouldNot(rule: ValidationRule[Request]): Endpoint[Request]

    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
  32. final def shouldNot(rule: String)(predicate: (Request) ⇒ Boolean): Endpoint[Request]

    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
  33. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  34. final def toService(implicit tr: ToResponse.Aux[Request, Json], tre: ToResponse.Aux[Exception, Json]): Service[Request, Response]

    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.

    Consider using Bootstrap instead.

    Definition Classes
    Endpoint
  35. final def toServiceAs[CT <: String](implicit tr: ToResponse.Aux[Request, CT], tre: ToResponse.Aux[Exception, CT]): Service[Request, Response]

    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.

    Consider using Bootstrap instead.

    Definition Classes
    Endpoint
  36. final def toString(): String
    Definition Classes
    root → AnyRef → Any
  37. final def transform[B](fn: (Future[Output[Request]]) ⇒ 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
  38. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  41. final def withToString(ts: ⇒ String): Endpoint[Request]

    Overrides the toString method on this endpoint.

    Overrides the toString method on this endpoint.

    Definition Classes
    Endpoint

Inherited from Endpoint[Request]

Inherited from AnyRef

Inherited from Any

Ungrouped