aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/cowboy_constraints.nonempty.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-09-04 14:33:44 +0200
committerLoïc Hoguin <[email protected]>2017-09-04 14:33:44 +0200
commit58e9e76814a8291894ba01ac8a4551e4f8d480b3 (patch)
tree58145af48e5c9dbcec51ffec14bb9faea25c6b24 /doc/src/manual/cowboy_constraints.nonempty.asciidoc
parent47aa0097ed3f63bf0de1b540a6a8d4086e3d2ea6 (diff)
downloadcowboy-58e9e76814a8291894ba01ac8a4551e4f8d480b3.tar.gz
cowboy-58e9e76814a8291894ba01ac8a4551e4f8d480b3.tar.bz2
cowboy-58e9e76814a8291894ba01ac8a4551e4f8d480b3.zip
Fix more documentation todos
I have decided not to include a manual page for cowboy_stream_h at this point because it clashes with the cowboy_stream manual page. This decision will be revisited in the future.
Diffstat (limited to 'doc/src/manual/cowboy_constraints.nonempty.asciidoc')
-rw-r--r--doc/src/manual/cowboy_constraints.nonempty.asciidoc62
1 files changed, 62 insertions, 0 deletions
diff --git a/doc/src/manual/cowboy_constraints.nonempty.asciidoc b/doc/src/manual/cowboy_constraints.nonempty.asciidoc
new file mode 100644
index 0000000..0c25b4b
--- /dev/null
+++ b/doc/src/manual/cowboy_constraints.nonempty.asciidoc
@@ -0,0 +1,62 @@
+= cowboy_constraints:nonempty(3)
+
+== Name
+
+cowboy_constraints:nonempty - Non-empty constraint
+
+== Description
+
+Constraint functions implement a number of different operations.
+
+[source,erlang]
+----
+nonempty(forward | reverse, <<>>) -> {error, empty}
+----
+
+Reject empty values.
+
+[source,erlang]
+----
+nonempty(forward | reverse, Bin) -> {ok, Bin}
+
+Bin :: binary()
+----
+
+Accept any other binary values.
+
+[source,erlang]
+----
+nonempty(format_error, Error) -> HumanReadable
+
+Error :: {empty, Bin}
+HumanReadable :: iolist()
+----
+
+Generate a human-readable error message.
+
+== Arguments
+
+Arguments vary depending on the operation. Constraint
+functions always take the operation type as first argument,
+and the value as second argument.
+
+== Return value
+
+The return value varies depending on the operation.
+
+== Changelog
+
+* *2.0*: Interface modified to allow for a variety of operations.
+* *1.0*: Constraint introduced.
+
+== Examples
+
+This function is not meant to be called directly.
+
+== See also
+
+link:man:cowboy_constraints(3)[cowboy_constraints(3)],
+link:man:cowboy_constraints:int(3)[cowboy_constraints:int(3)],
+link:man:cowboy_router(3)[cowboy_router(3)],
+link:man:cowboy_req:match_cookies(3)[cowboy_req:match_cookies(3)],
+link:man:cowboy_req:match_qs(3)[cowboy_req:match_qs(3)]