An abstraction that is responsible for decoding the request of general type.
An abstraction that is responsible for decoding the request of type A
.
An exception that indicates that a request item could be parsed.
An exception that indicates a required request item (header, param, cookie, body) was missing in the request.
An exception that indicates a broken ValidationRule]] on the request item.
A base exception of request reader.
An exception that collects multiple request reader errors.
A RequestReader
(a reader monad) that reads a Future of A
from the request of type R
.
A ValidationRule
enables a reusable way of defining a validation rules in the application domain.
Convenience methods for creating new reader instances.
Allows the creation of reusable validation rules for RequestReaders.
A ValidationRule that makes sure the numeric value is greater than given n
.
A ValidationRule]] that makes sure the numeric value is less than given n
.
A ValidationRule]] that makes sure the string value is longer than n
symbols.
A ValidationRule]] that makes sure the string value is shorter than n
symbols.
A RequestReader that reads a required binary request body, interpreted as a Array[Byte]
, or throws a
NotPresent exception.
A RequestReader that reads a binary request body, interpreted as a Array[Byte]
, into an Option
.
A RequestReader that reads the required request body, interpreted as a String
, or throws a NotPresent
exception.
A RequestReader that reads an optional request body, interpreted as a String
, into an Option
.
Creates a RequestReader that reads a required cookie from the request or raises a NotPresent exception when the cookie is missing.
Creates a RequestReader that reads a required cookie from the request or raises a NotPresent exception when the cookie is missing.
the name of the cookie to read
the cookie
Creates a RequestReader that reads an optional HTTP cookie from the request into an Option
.
Creates a RequestReader that reads an optional HTTP cookie from the request into an Option
.
the name of the cookie to read
an Option
that contains a cookie or None if the cookie does not exist on the request.
Creates a RequestReader that reads a required file upload from a multipart/form-data request.
Creates a RequestReader that reads a required file upload from a multipart/form-data request.
the name of the parameter to read
the file
Creates a RequestReader that reads an optional file upload from a multipart/form-data request into an Option
.
Creates a RequestReader that reads an optional file upload from a multipart/form-data request into an Option
.
the name of the parameter to read
an Option
that contains the file or None
is the parameter does not exist on the request.
Creates a RequestReader that reads a required HTTP header name
from the request or raises a NotPresent
exception when the header is missing.
Creates a RequestReader that reads a required HTTP header name
from the request or raises a NotPresent
exception when the header is missing.
the header to read
a header
Creates a RequestReader that reads an optional HTTP header name
from the request into an Option
.
Creates a RequestReader that reads an optional HTTP header name
from the request into an Option
.
the header to read
an Option
that contains a header value or None
if the header is not present in the request
Representations for the various types that can be processed with RequestReaders.
Creates a RequestReader that reads a required query-string param name
from the request or raises a
NotPresent exception when the param is missing; a NotValid exception is the param is empty.
Creates a RequestReader that reads a required query-string param name
from the request or raises a
NotPresent exception when the param is missing; a NotValid exception is the param is empty.
the param name to read
a param value
Creates a RequestReader that reads an optional query-string param name
from the request into an Option
.
Creates a RequestReader that reads an optional query-string param name
from the request into an Option
.
the param to read
an Option
that contains a param value or None
if the param is empty
Creates a RequestReader 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
.
Creates a RequestReader 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
.
the param to read
a Seq
that contains all the values of multi-value param or an empty seq Nil
if the params are missing
or empty.
Creates a RequestReader that reads a required (in a meaning that a resulting Seq
will have at least one
element) multi-value query-string param name
from the request into a Seq
or raises a NotPresent exception
when the params are missing or empty.
Creates a RequestReader that reads a required (in a meaning that a resulting Seq
will have at least one
element) multi-value query-string param name
from the request into a Seq
or raises a NotPresent exception
when the params are missing or empty.
the param to read
a Seq
that contains all the values of multi-value param
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 }
the underlying function to convert
This package introduces types and functions that enable _request processing_ in Finch. The io.finch.request primitives allow both to _read_ the various request items (query string param, header and cookie) using the RequestReader and _validate_ them using the ValidationRule.