int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer()
cowboy_constraints:int - Integer constraint
Constraint functions implement a number of different operations.
int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer()
Validate and convert the text representation of an integer.
int(reverse, Int) -> {ok, Bin} | {error, not_an_integer}
Convert an integer back to its text representation.
int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist()
Generate a human-readable error message.
Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument.
The return value varies depending on the operation.
This function is not meant to be called directly.
cowboy_constraints(3), cowboy_constraints:nonempty(3), cowboy_router(3), cowboy_req:match_cookies(3), cowboy_req:match_qs(3)
Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:
Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.