Package

io

finch

Permalink

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.

Linear Supertypes
EndpointMappers, ValidationRules, Outputs, Endpoints, FileUploadsAndAttributes, Cookies, ParamAndParams, Headers, Paths, Bodies, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. finch
  2. EndpointMappers
  3. ValidationRules
  4. Outputs
  5. Endpoints
  6. FileUploadsAndAttributes
  7. Cookies
  8. ParamAndParams
  9. Headers
  10. Paths
  11. Bodies
  12. AnyRef
  13. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Bootstrap[ES <: HList, CTS <: HList] extends AnyRef

    Permalink

    Bootstraps a Finagle HTTP service out of the collection of Finch endpoints.

    Bootstraps a Finagle HTTP service out of the collection of Finch endpoints.

    val api: Service[Request, Response] = Bootstrap
     .serve[Application.Json](getUser :+: postUser)
     .serve[Text.Plain](healthcheck)
     .toService
    Note

    This API is experimental/unstable. Use with caution.

  2. trait Decode[A] extends AnyRef

    Permalink

    Decodes an HTTP payload represented as Buf (encoded with Charset) into an arbitrary type A.

  3. trait DecodeEntity[A] extends AnyRef

    Permalink

    Decodes an HTTP entity (eg: header, query-string param) represented as UTF-8 String into an arbitrary type A.

  4. trait DecodePath[A] extends AnyRef

    Permalink

    Decodes an HTTP path (eg: /foo/bar/baz) represented as UTF-8 String into an arbitrary type A.

  5. trait Encode[A] extends AnyRef

    Permalink

    Encodes an HTTP payload (represented as an arbitrary type A) with a given Charset.

  6. trait Endpoint[A] extends AnyRef

    Permalink

    An Endpoint represents the HTTP endpoint.

    An Endpoint represents the HTTP endpoint.

    It is well known and widely adopted in Finagle that "Your Server is a Function" (i.e., Request => Future[Response]). In a REST/HTTP API setting this function may be viewed as Request =1=> (A =2=> Future[B]) =3=> Future[Response], where transformation 1 is a request decoding (deserialization), transformation 2 - is a business logic and transformation 3 is - a response encoding (serialization). The only interesting part here is transformation 2 (i.e., A => Future[B]), which represents an application business.

    An Endpoint transformation (map, mapAsync, etc.) encodes the business logic, while the rest of Finch ecosystem takes care about both serialization and deserialization.

    A typical way to transform (or map) the Endpoint is to use io.finch.syntax.Mapper:

    import io.finch._
    
    case class Foo(i: Int)
    case class Bar(s: String)
    
    val foo: Endpoint[Foo] = get("foo") { Ok(Foo(42)) }
    val bar: Endpoint[Bar] = get("bar" :: path[String]) { s: String => Ok(Bar(s)) }

    Endpoints are also composable in terms of or-else combinator (known as a "space invader" operator :+:) that takes two Endpoints and returns a coproduct Endpoint.

    import io.finch._
    
    val foobar: Endpoint[Foo :+: Bar :+: CNil] = foo :+: bar

    An Endpoint might be converted into a Finagle Service with Endpoint.toService method so it can be served within Finagle HTTP.

    import com.twitter.finagle.Http
    
    Http.server.serve(foobar.toService)
  7. sealed abstract class EndpointResult[+A] extends AnyRef

    Permalink

    A result returned from an Endpoint.

    A result returned from an Endpoint. This models Option[(Input, Future[Output])] and represents two cases:

    • Endpoint is matched so both remainder and output is returned.
    • Endpoint is skipped so None is returned.

    API methods exposed on this type are mostly introduced for testing.

    This class also provides various of awaitX methods useful for testing and experimenting.

  8. trait Endpoints extends Bodies with Paths with Headers with ParamAndParams with Cookies with FileUploadsAndAttributes

    Permalink

    A collection of Endpoint combinators.

  9. sealed abstract class Error extends Exception with NoStackTrace

    Permalink

    A single error from an Endpoint.

    A single error from an Endpoint.

    This indicates that one of the Finch's built-in components failed. This includes, but not limited by:

    - reading a required param, body, header, etc. - parsing a string-based endpoint with .as[T] combinator - validating an endpoint with .should or shouldNot combinators

  10. case class Errors(errors: NonEmptyList[Error]) extends Exception with NoStackTrace with Product with Serializable

    Permalink

    Multiple errors from an Endpoint.

    Multiple errors from an Endpoint.

    This type of error indicates that an endpoint is able to accumulate multiple Errors into a single instance of Errors that embeds a non-empty list.

    Error accumulation happens as part of the .product (or adjoin, ::) combinator.

  11. trait HighPriorityDecode extends LowPriorityDecode

    Permalink
  12. trait HighPriorityEncodeInstances extends LowPriorityEncodeInstances

    Permalink
  13. trait HighPriorityToResponseInstances extends LowPriorityToResponseInstances

    Permalink
  14. final case class Input(request: Request, route: Seq[String]) extends Product with Serializable

    Permalink

    An input for Endpoint that glues two individual pieces together:

    An input for Endpoint that glues two individual pieces together:

    - Finagle's Request needed for evaluating (e.g., body, param) - Finch's route (represented as Seq[String]) needed for matching (e.g., path)

  15. trait LowPriorityDecode extends AnyRef

    Permalink
  16. trait LowPriorityEncodeInstances extends AnyRef

    Permalink
  17. trait LowPriorityToResponseInstances extends AnyRef

    Permalink
  18. sealed trait Output[+A] extends AnyRef

    Permalink

    An output of Endpoint.

  19. trait Outputs extends AnyRef

    Permalink
  20. trait ToResponse[A] extends AnyRef

    Permalink

    Represents a conversion from A to Response.

  21. trait ToService[ES <: HList, CTS <: HList] extends AnyRef

    Permalink

    Wraps a given list of Endpoints and their content-types with a Finagle Service.

    Wraps a given list of Endpoints and their content-types with a Finagle Service.

    Guarantees to:

    - handle Finch's own errors (i.e., Error and Error) as 400s - copy requests's HTTP version onto a response - respond with 404 when en endpoint is not matched

    - include the date header on each response (unless disabled) - include the server header on each response (unless disabled)

    Annotations
    @implicitNotFound( ... )
  22. trait ValidationRule[A] extends AnyRef

    Permalink

    A ValidationRule enables a reusable way of defining a validation rules in the application domain.

    A ValidationRule enables a reusable way of defining a validation rules in the application domain. It might be composed with Endpoints using either should or shouldNot methods and with other ValidationRules using logical methods and and or.

    case class User(name: String, age: Int)
    val user: Endpoint[User] = (
      param("name").should(beLongerThan(3)) ::
      param("age").as[Int].should(beGreaterThan(0) and beLessThan(120))
    ).as[User]
  23. trait ValidationRules extends AnyRef

    Permalink

Value Members

  1. object * extends Endpoint[HNil]

    Permalink

    An Endpoint that skips all path segments.

    An Endpoint that skips all path segments.

    Definition Classes
    Endpoints
  2. object / extends Endpoint[HNil]

    Permalink

    An identity Endpoint.

    An identity Endpoint.

    Definition Classes
    Endpoints
  3. def Accepted[A]: Output[A]

    Permalink
    Definition Classes
    Outputs
  4. object Application

    Permalink
  5. def BadGateway(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  6. def BadRequest(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  7. object Bootstrap extends Bootstrap[HNil, HNil]

    Permalink
  8. def Conflict(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  9. def Created[A](a: A): Output[A]

    Permalink
    Definition Classes
    Outputs
  10. object Decode

    Permalink
  11. object DecodeEntity extends HighPriorityDecode

    Permalink
  12. object DecodePath

    Permalink
  13. object Encode extends HighPriorityEncodeInstances

    Permalink
  14. object Endpoint

    Permalink

    Provides extension methods for Endpoint to support coproduct and path syntax.

  15. object EndpointResult

    Permalink
  16. def EnhanceYourCalm(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  17. object Error extends Serializable

    Permalink
  18. def Forbidden(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  19. def GatewayTimeout(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  20. def Gone(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  21. object Input extends Serializable

    Permalink

    Creates an input for Endpoint from Request.

  22. def InsufficientStorage(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  23. def InternalServerError(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  24. def LengthRequired(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  25. def MethodNotAllowed(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  26. def NoContent[A]: Output[A]

    Permalink
    Definition Classes
    Outputs
  27. def NotAcceptable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  28. def NotFound(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  29. def NotImplemented(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  30. def Ok[A](a: A): Output[A]

    Permalink
    Definition Classes
    Outputs
  31. object Output

    Permalink
  32. def PaymentRequired(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  33. def PreconditionFailed(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  34. def RequestEntityTooLarge(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  35. def RequestTimeout(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  36. def RequestedRangeNotSatisfiable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  37. def ServiceUnavailable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  38. object Text

    Permalink
  39. object ToResponse extends HighPriorityToResponseInstances

    Permalink
  40. object ToService

    Permalink

    Wraps a given Endpoint with a Finagle Service.

    Wraps a given Endpoint with a Finagle Service.

    Guarantees to:

    - handle Finch's own errors (i.e., Error and Error) as 400s - copy requests's HTTP version onto a response - respond with 404 when en endpoint is not matched

  41. def TooManyRequests(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  42. def Unauthorized(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  43. def UnprocessableEntity(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  44. object ValidationRule

    Permalink

    Allows the creation of reusable validation rules for Endpoints.

  45. val asyncBody: Endpoint[AsyncStream[Buf]]

    Permalink

    An evaluating Endpoint that reads a required chunked streaming binary body, interpreted as an AsyncStream[Buf].

    An evaluating Endpoint that reads a required chunked streaming binary body, interpreted as an AsyncStream[Buf]. The returned Endpoint only matches chunked (streamed) requests.

    Definition Classes
    Bodies
  46. def beGreaterThan[A](n: A)(implicit ev: Numeric[A]): ValidationRule[A]

    Permalink

    A ValidationRule that makes sure the numeric value is greater than given n.

    A ValidationRule that makes sure the numeric value is greater than given n.

    Definition Classes
    ValidationRules
  47. def beLessThan[A](n: A)(implicit ev: Numeric[A]): ValidationRule[A]

    Permalink

    A ValidationRule that makes sure the numeric value is less than given n.

    A ValidationRule that makes sure the numeric value is less than given n.

    Definition Classes
    ValidationRules
  48. def beLongerThan(n: Int): ValidationRule[String]

    Permalink

    A ValidationRule that makes sure the string value is longer than n symbols.

    A ValidationRule that makes sure the string value is longer than n symbols.

    Definition Classes
    ValidationRules
  49. def beShorterThan(n: Int): ValidationRule[String]

    Permalink

    A ValidationRule that makes sure the string value is shorter than n symbols.

    A ValidationRule that makes sure the string value is shorter than n symbols.

    Definition Classes
    ValidationRules
  50. val binaryBody: Endpoint[Array[Byte]]

    Permalink

    An evaluating Endpoint that reads a required binary request body, interpreted as an Array[Byte], or throws a Error.NotPresent exception.

    An evaluating Endpoint that reads a required binary request body, interpreted as an Array[Byte], or throws a Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  51. val binaryBodyOption: Endpoint[Option[Array[Byte]]]

    Permalink

    An evaluating Endpoint that reads a binary request body, interpreted as a Array[Byte], into an Option.

    An evaluating Endpoint that reads a binary request body, interpreted as a Array[Byte], into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  52. def body[A, CT <: String](implicit d: Aux[A, CT], ct: ClassTag[A]): Endpoint[A]

    Permalink

    An Endpoint that reads the required request body represented as CT (ContentType) and interpreted as A, or throws an Error.NotPresent exception.

    An Endpoint that reads the required request body represented as CT (ContentType) and interpreted as A, or throws an Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  53. def bodyOption[A, CT <: String](implicit d: Aux[A, CT], ct: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    An Endpoint that reads an optional request body represented as CT (ContentType) and interpreted as A, into an Option.

    An Endpoint that reads an optional request body represented as CT (ContentType) and interpreted as A, into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  54. implicit def booleanToPath(b: Boolean): Endpoint[HNil]

    Permalink
    Definition Classes
    Paths
  55. def connect[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is CONNECT and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  56. def cookie(name: String): Endpoint[Cookie]

    Permalink

    An evaluating Endpoint that reads a required cookie from the request or raises an Error.NotPresent exception when the cookie is missing.

    An evaluating Endpoint that reads a required cookie from the request or raises an Error.NotPresent exception when the cookie is missing.

    Definition Classes
    Cookies
  57. def cookieOption(name: String): Endpoint[Option[Cookie]]

    Permalink

    An evaluating Endpoint that reads an optional HTTP cookie from the request into an Option.

    An evaluating Endpoint that reads an optional HTTP cookie from the request into an Option.

    Definition Classes
    Cookies
  58. def delete[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is DELETE and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  59. def get[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is GET and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  60. def head[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is HEAD and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  61. def header[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[A]

    Permalink

    An evaluating Endpoint that reads a required HTTP header name from the request or raises an Error.NotPresent exception when the header is missing.

    An evaluating Endpoint that reads a required HTTP header name from the request or raises an Error.NotPresent exception when the header is missing.

    Definition Classes
    Headers
  62. def headerExists[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[A]

    Permalink

    A matching Endpoint that only matches the requests that contain a given header name.

    A matching Endpoint that only matches the requests that contain a given header name.

    Definition Classes
    Headers
  63. def headerOption[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    An evaluating Endpoint that reads an optional HTTP header name from the request into an Option.

    An evaluating Endpoint that reads an optional HTTP header name from the request into an Option.

    Definition Classes
    Headers
  64. implicit def intToPath(i: Int): Endpoint[HNil]

    Permalink
    Definition Classes
    Paths
  65. package internal

    Permalink

    This package contains an internal-use only type-classes and utilities that power Finch's API.

    This package contains an internal-use only type-classes and utilities that power Finch's API.

    It's not recommended to use any of the internal API directly, since it might change without any deprecation cycles.

  66. object items

    Permalink
  67. def jsonBody[A](implicit arg0: Json[A], arg1: ClassTag[A]): Endpoint[A]

    Permalink

    Alias for body[A, Application.Json].

    Alias for body[A, Application.Json].

    Definition Classes
    Bodies
  68. def jsonBodyOption[A](implicit arg0: Json[A], arg1: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    Alias for bodyOption[A, Application.Json].

    Alias for bodyOption[A, Application.Json].

    Definition Classes
    Bodies
  69. def multipartAttribute[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[A]

    Permalink

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  70. def multipartAttributeOption[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    An evaluating Endpoint that reads an optional attribute from a multipart/form-data request.

    An evaluating Endpoint that reads an optional attribute from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  71. def multipartAttributes[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[Seq[A]]

    Permalink

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  72. def multipartAttributesNel[A](name: String)(implicit d: DecodeEntity[A], t: ClassTag[A]): Endpoint[NonEmptyList[A]]

    Permalink

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    An evaluating Endpoint that reads a required attribute from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  73. def multipartFileUpload(name: String): Endpoint[FileUpload]

    Permalink

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  74. def multipartFileUploadOption(name: String): Endpoint[Option[FileUpload]]

    Permalink

    An evaluating Endpoint that reads an optional file upload from a multipart/form-data request into an Option.

    An evaluating Endpoint that reads an optional file upload from a multipart/form-data request into an Option.

    Definition Classes
    FileUploadsAndAttributes
  75. def multipartFileUploads(name: String): Endpoint[Seq[FileUpload]]

    Permalink

    An evaluating Endpoint that optionally reads multiple file uploads from a multipart/form-data request.

    An evaluating Endpoint that optionally reads multiple file uploads from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  76. def multipartFileUploadsNel(name: String): Endpoint[NonEmptyList[FileUpload]]

    Permalink

    An evaluating Endpoint that requires multiple file uploads from a multipart/form-data request.

    An evaluating Endpoint that requires multiple file uploads from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
  77. def options[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is OPTIONS and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  78. def param[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[A]

    Permalink

    An evaluating Endpoint that reads a required query-string param name from the request or raises an Error.NotPresent exception when the param is missing; an Error.NotValid exception is the param is empty.

    An evaluating Endpoint that reads a required query-string param name from the request or raises an Error.NotPresent exception when the param is missing; an Error.NotValid exception is the param is empty.

    Definition Classes
    ParamAndParams
  79. def paramExists[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[A]

    Permalink

    A matching Endpoint that only matches the requests that contain a given query-string param name.

    A matching Endpoint that only matches the requests that contain a given query-string param name.

    Definition Classes
    ParamAndParams
  80. def paramOption[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    An evaluating Endpoint that reads an optional query-string param name from the request into an Option.

    An evaluating Endpoint that reads an optional query-string param name from the request into an Option.

    Definition Classes
    ParamAndParams
  81. def params[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[Seq[A]]

    Permalink

    An evaluating Endpoint that reads an optional (in a meaning that a resulting Seq may be empty) multi-value query-string param name from the request into a Seq.

    An evaluating Endpoint that reads an optional (in a meaning that a resulting Seq may be empty) multi-value query-string param name from the request into a Seq.

    Definition Classes
    ParamAndParams
  82. def paramsNel[A](name: String)(implicit d: DecodeEntity[A], tag: ClassTag[A]): Endpoint[NonEmptyList[A]]

    Permalink

    An evaluating Endpoint that reads a required multi-value query-string param name from the request into a NonEmptyList or raises a Error.NotPresent exception when the params are missing or empty.

    An evaluating Endpoint that reads a required multi-value query-string param name from the request into a NonEmptyList or raises a Error.NotPresent exception when the params are missing or empty.

    Definition Classes
    ParamAndParams
  83. def patch[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is PATCH and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  84. def path(s: String): Endpoint[HNil]

    Permalink

    An Endpoint that matches a given string.

    An Endpoint that matches a given string.

    Definition Classes
    Paths
  85. def path[A](implicit arg0: DecodePath[A], arg1: ClassTag[A]): Endpoint[A]

    Permalink

    A matching Endpoint that reads a value of type A (using the implicit DecodePath instances defined for A) from the current path segment.

    A matching Endpoint that reads a value of type A (using the implicit DecodePath instances defined for A) from the current path segment.

    Definition Classes
    Paths
  86. def paths[A](implicit arg0: DecodePath[A], arg1: ClassTag[A]): Endpoint[Seq[A]]

    Permalink

    A matching Endpoint that reads a tail value A (using the implicit DecodePath instances defined for A) from the entire path.

    A matching Endpoint that reads a tail value A (using the implicit DecodePath instances defined for A) from the entire path.

    Definition Classes
    Paths
  87. def post[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is POST and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  88. def put[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is PUT and the underlying endpoint succeeds on it.

    Definition Classes
    EndpointMappers
  89. object root extends Endpoint[Request]

    Permalink

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

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

    Definition Classes
    Endpoints
  90. val stringBody: Endpoint[String]

    Permalink

    An evaluating Endpoint that reads the required request body, interpreted as a String, or throws an Error.NotPresent exception.

    An evaluating Endpoint that reads the required request body, interpreted as a String, or throws an Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  91. val stringBodyOption: Endpoint[Option[String]]

    Permalink

    An evaluating Endpoint that reads an optional request body, interpreted as a String, into an Option.

    An evaluating Endpoint that reads an optional request body, interpreted as a String, into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Bodies
  92. implicit def stringToPath(s: String): Endpoint[HNil]

    Permalink
    Definition Classes
    Paths
  93. package syntax

    Permalink

    Enables Sinatra-like syntax extensions for endpoints.

  94. def textBody[A](implicit arg0: Text[A], arg1: ClassTag[A]): Endpoint[A]

    Permalink

    Alias for body[A, Text.Plain]

    Alias for body[A, Text.Plain]

    Definition Classes
    Bodies
  95. def textBodyOption[A](implicit arg0: Text[A], arg1: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    Alias for bodyOption[A, Text.Plain]

    Alias for bodyOption[A, Text.Plain]

    Definition Classes
    Bodies
  96. implicit def toOptionalInlineRule[A](fn: (A) ⇒ Boolean): (Option[A]) ⇒ Boolean

    Permalink

    Implicit conversion that allows the same inline rules to be used for required and optional values.

    Implicit conversion that allows the same inline rules to be used for required and optional values. If the optional value is non-empty, it gets validated (and validation may fail, producing error), but if it is empty, it is always treated as valid.

    In order to help the compiler determine the case when inline rule should be converted, the type of the validated value should be specified explicitly.

    paramOption("foo").should("be greater than 50") { i: Int => i > 50 }
    fn

    the underlying function to convert

    Definition Classes
    ValidationRules
  97. def trace[A](e: Endpoint[A]): EndpointMapper[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is TRACE and the underlying router endpoint on it.

    Definition Classes
    EndpointMappers

Deprecated Value Members

  1. def boolean(name: String): Endpoint[Boolean]

    Permalink

    A matching Endpoint that reads a boolean value from the current path segment.

    A matching Endpoint that reads a boolean value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Boolean].withToString(String) instead

  2. val boolean: Endpoint[Boolean]

    Permalink

    A matching Endpoint that reads a boolean value from the current path segment.

    A matching Endpoint that reads a boolean value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Boolean] instead

  3. val booleans: Endpoint[Seq[Boolean]]

    Permalink

    A matching Endpoint that reads a boolean tail from the current path segment.

    A matching Endpoint that reads a boolean tail from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use paths[Boolean] instead

  4. def fileUpload(name: String): Endpoint[FileUpload]

    Permalink

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    Definition Classes
    FileUploadsAndAttributes
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use multipartFileUpload instead

  5. def fileUploadOption(name: String): Endpoint[Option[FileUpload]]

    Permalink

    An evaluating Endpoint that reads an optional file upload from a multipart/form-data request into an Option.

    An evaluating Endpoint that reads an optional file upload from a multipart/form-data request into an Option.

    Definition Classes
    FileUploadsAndAttributes
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use multipartFileUploadOption instead

  6. def int(name: String): Endpoint[Int]

    Permalink

    A matching Endpoint that reads an integer value from the current path segment.

    A matching Endpoint that reads an integer value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Int].withToString(String) instead

  7. val int: Endpoint[Int]

    Permalink

    A matching Endpoint that reads an integer value from the current path segment.

    A matching Endpoint that reads an integer value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Int] instead

  8. val ints: Endpoint[Seq[Int]]

    Permalink

    A matching Endpoint that reads a string tail from the current path segment.

    A matching Endpoint that reads a string tail from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use paths[Int] instead

  9. def long(name: String): Endpoint[Long]

    Permalink

    A matching Endpoint that reads a long value from the current path segment.

    A matching Endpoint that reads a long value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Long].withToString(String) instead

  10. val long: Endpoint[Long]

    Permalink

    A matching Endpoint that reads a long value from the current path segment.

    A matching Endpoint that reads a long value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[Long] instead

  11. val longs: Endpoint[Seq[Long]]

    Permalink

    A matching Endpoint that reads a long tail from the current path segment.

    A matching Endpoint that reads a long tail from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use paths[Long] instead

  12. def string(name: String): Endpoint[String]

    Permalink

    A matching Endpoint that reads a string value from the current path segment.

    A matching Endpoint that reads a string value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[String].withToString(String) instead

  13. val string: Endpoint[String]

    Permalink

    A matching Endpoint that reads a string value from the current path segment.

    A matching Endpoint that reads a string value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[String] instead

  14. val strings: Endpoint[Seq[String]]

    Permalink

    A matching Endpoint that reads a string tail from the current path segment.

    A matching Endpoint that reads a string tail from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use paths[String] instead

  15. def uuid(name: String): Endpoint[UUID]

    Permalink

    A matching Endpoint that reads a UUID value from the current path segment.

    A matching Endpoint that reads a UUID value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[UUID].withToString(String) instead

  16. val uuid: Endpoint[UUID]

    Permalink

    A matching Endpoint that reads an UUID value from the current path segment.

    A matching Endpoint that reads an UUID value from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use path[UUID] instead

  17. val uuids: Endpoint[Seq[UUID]]

    Permalink

    A matching Endpoint that reads a UUID tail from the current path segment.

    A matching Endpoint that reads a UUID tail from the current path segment.

    Definition Classes
    Paths
    Annotations
    @deprecated
    Deprecated

    (Since version 0.16) Use paths[UUID] instead

Inherited from EndpointMappers

Inherited from ValidationRules

Inherited from Outputs

Inherited from Endpoints

Inherited from FileUploadsAndAttributes

Inherited from Cookies

Inherited from ParamAndParams

Inherited from Headers

Inherited from Paths

Inherited from Bodies

Inherited from AnyRef

Inherited from Any

Ungrouped