From 490056310be890ced37e6fb2899e573bb388db89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 4 Oct 2019 15:25:24 +0200 Subject: Add cow_cookie manual --- _build/Makefile | 2 +- _build/data/projects/cowlib.toml | 3 +- .../2.7/manual/cow_cookie.parse_cookie/index.html | 180 +++++++++++++++++++ .../2.7/manual/cow_cookie.setcookie/index.html | 190 ++++++++++++++++++++ docs/en/cowlib/2.7/manual/cow_cookie/index.html | 195 +++++++++++++++++++++ docs/en/cowlib/2.7/manual/cowlib_app/index.html | 171 ++++++++++++++++++ docs/en/cowlib/2.7/manual/index.html | 156 +++++++++++++++++ docs/index.html | 12 ++ docs/index.xml | 61 +++++++ donate/index.html | 10 ++ index.html | 12 ++ index.xml | 61 +++++++ services/index.html | 10 ++ sitemap.xml | 20 +++ 14 files changed, 1081 insertions(+), 2 deletions(-) create mode 100644 docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/index.html create mode 100644 docs/en/cowlib/2.7/manual/cow_cookie.setcookie/index.html create mode 100644 docs/en/cowlib/2.7/manual/cow_cookie/index.html create mode 100644 docs/en/cowlib/2.7/manual/cowlib_app/index.html create mode 100644 docs/en/cowlib/2.7/manual/index.html diff --git a/_build/Makefile b/_build/Makefile index 37fa58a0..d307924e 100644 --- a/_build/Makefile +++ b/_build/Makefile @@ -68,7 +68,7 @@ docs-$1-$2: tmp/$1 mkdir -p static/docs/en/$1/$3/guide/; \ cp tmp/$1/doc/src/guide/* static/docs/en/$1/$3/guide/; \ fi - if [ -f tmp/$1/doc/src/manual/$1.asciidoc ]; then \ + if [ -f tmp/$1/doc/src/manual/$1_app.asciidoc ]; then \ mkdir -p content/docs/en/$1/$3/manual/; \ printf "%s\n" "+++" "title = \"`sed 's/\(.\)/\U\1/' <<< $1` Function Reference\"" \ "project = \"$1\"" "version = \"$3\"" "doctype = \"manual\"" "+++" "" \ diff --git a/_build/data/projects/cowlib.toml b/_build/data/projects/cowlib.toml index 9e007bf9..e87a1232 100644 --- a/_build/data/projects/cowlib.toml +++ b/_build/data/projects/cowlib.toml @@ -3,6 +3,7 @@ catchphrase = "Support library for the Web." description = "The Web toolbox for HTTP/1.1, HTTP/2, Websocket, Multipart, Cookies, URL encoding..." name = "cowlib" repository = "https://github.com/ninenines/cowlib" -versions = ["2.0"] +versions = ["2.7"] branches = ["master"] has_source = true +has_manual = true diff --git a/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/index.html b/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/index.html new file mode 100644 index 00000000..ca21195a --- /dev/null +++ b/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/index.html @@ -0,0 +1,180 @@ + + + + + + + + + + Nine Nines: cow_cookie:parse_cookie(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cow_cookie:parse_cookie(3)

+ +

Name

+

cow_cookie:parse_cookie - Parse a cookie header

+

Description

+
+
parse_cookie(Cookie :: binary())
+    -> [{binary(), binary()}]
+
+

Parse a cookie header.

+

Arguments

+
Cookie
+

The cookie header value.

+
+
+

Return value

+

A list of cookie name/value pairs is returned on success.

+

An exception is thrown in the event of a parse error.

+

Changelog

+
  • 1.0: Function introduced. +
  • +
+

Examples

+
Parse a cookie header
+
+
Cookies = cow_cookie:parse_cookie(CookieHd).
+
+

See also

+

cow_cookie(3), cow_cookie:setcookie(3)

+ + + + + + +
+ +
+ + +

+ Cowlib + 2.7 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+
    + + + +
  • 2.7
  • + +
+ +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + diff --git a/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/index.html b/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/index.html new file mode 100644 index 00000000..098daabb --- /dev/null +++ b/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/index.html @@ -0,0 +1,190 @@ + + + + + + + + + + Nine Nines: cow_cookie:setcookie(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cow_cookie:setcookie(3)

+ +

Name

+

cow_cookie:setcookie - Generate a set-cookie header

+

Description

+
+
setcookie(Name  :: iodata(),
+          Value :: iodata(),
+          Opts  :: cow_cookie:cookie_opts())
+    -> iolist()
+
+

Generate a set-cookie header.

+

Arguments

+
Name
+

Cookie name.

+
+
Value
+

Cookie value.

+
+
Opts
+

Options added to the set-cookie header as attributes.

+
+
+

Return value

+

An iolist with the generated set-cookie header value.

+

Changelog

+
  • 1.0: Function introduced. +
  • +
+

Examples

+
Generate a set-cookie header
+
+
SetCookie = cow_cookie:setcookie(<<"sessionid">>, ID, #{
+    http_only => true,
+    secure => true
+}).
+
+

See also

+

cow_cookie(3), cow_cookie:parse_cookie(3)

+ + + + + + +
+ +
+ + +

+ Cowlib + 2.7 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+
    + + + +
  • 2.7
  • + +
+ +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + diff --git a/docs/en/cowlib/2.7/manual/cow_cookie/index.html b/docs/en/cowlib/2.7/manual/cow_cookie/index.html new file mode 100644 index 00000000..066c5a3c --- /dev/null +++ b/docs/en/cowlib/2.7/manual/cow_cookie/index.html @@ -0,0 +1,195 @@ + + + + + + + + + + Nine Nines: cow_cookie(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cow_cookie(3)

+ +

Name

+

cow_cookie - Cookies

+

Description

+

The module cow_cookie provides functions for parsing and manipulating cookie headers.

+

Exports

+ +

Types

+ +
+
cookie_opts() :: [Option]
+
+Option :: {domain, binary()}
+        | {http_only, boolean()}
+        | {max_age, non_neg_integer()}
+        | {path, binary()}
+        | {same_site, lax | strict}
+        | {secure, boolean()}
+
+

Options for the set-cookie header. They are added to the header as attributes. More information about the options can be found in RFC 6265.

+

The following options are defined:

+
domain
+

Hosts to which the cookie will be sent. By default it will only be sent to the origin server.

+
+
http_only
+

Whether the cookie should be restricted to HTTP requests, or it should also be exposed to other APIs, for example Javascript. By default there are no restrictions.

+
+
max_age
+

Maximum lifetime of the cookie, in seconds. By default the cookie is kept for the duration of the session.

+
+
path
+

Path to which the cookie will be sent. By default it will be sent to the current "directory" of the effective request URI.

+
+
same_site
+

Whether the cookie should be sent along with cross-site requests. This header is currently non-standard but is in the process of being standardized. Please refer to the RFC 6265 (bis) draft for details.

+
+
secure
+

Whether the cookie should be sent only on secure channels (for example TLS). Note that this does not guarantee the integrity of the cookie, only its confidentiality during transfer. By default there are no restrictions.

+
+
+

See also

+

cowlib(7), RFC 6265

+ + + + + + +
+ +
+ + +

+ Cowlib + 2.7 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+
    + + + +
  • 2.7
  • + +
+ +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + diff --git a/docs/en/cowlib/2.7/manual/cowlib_app/index.html b/docs/en/cowlib/2.7/manual/cowlib_app/index.html new file mode 100644 index 00000000..ca753d1a --- /dev/null +++ b/docs/en/cowlib/2.7/manual/cowlib_app/index.html @@ -0,0 +1,171 @@ + + + + + + + + + + Nine Nines: cowlib(7) + + + + + + + + + + + + + + + + +
+
+
+
+ +

cowlib(7)

+ +

Name

+

cowlib - Support library for manipulating Web protocols

+

Description

+

Cowlib provides libraries for parsing and building messages for various Web protocols, including HTTP/1.1, HTTP/2 and Websocket.

+

It is optimized for completeness rather than speed. No value is ignored, they are all returned.

+

Modules

+ +

Dependencies

+
  • crypto - Crypto functions +
  • +
+

All these applications must be started before the cowlib application. To start Cowlib and all dependencies at once:

+
+
{ok, _} = application:ensure_all_started(cowlib).
+
+

Environment

+

The cowlib application does not define any application environment configuration parameters.

+

See also

+

cowboy(7), gun(7)

+ + + + + + +
+ +
+ + +

+ Cowlib + 2.7 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+
    + + + +
  • 2.7
  • + +
+ +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + diff --git a/docs/en/cowlib/2.7/manual/index.html b/docs/en/cowlib/2.7/manual/index.html new file mode 100644 index 00000000..f6bc4637 --- /dev/null +++ b/docs/en/cowlib/2.7/manual/index.html @@ -0,0 +1,156 @@ + + + + + + + + + + Nine Nines: Cowlib Function Reference + + + + + + + + + + + + + + + + +
+
+
+
+ +

Cowlib Function Reference

+ + + + + + + + +
+ +
+ + +

+ Cowlib + 2.7 + Function Reference + +

+ + + +

Navigation

+ +

Version select

+
    + + + +
  • 2.7
  • + +
+ +

Like my work? Donate!

+

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

+
+ + + + + + + + + +

Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names.

+ + + +
+
+
+
+ + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 6f24a7c9..be09fb2e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -108,6 +108,16 @@ +

Cowlib

+ +

Erlang.mk

@@ -212,6 +222,8 @@ +
  • Cowlib
  • +
  • Erlang.mk
  • diff --git a/docs/index.xml b/docs/index.xml index 6b37af0e..1a9d42d3 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -2732,6 +2732,46 @@ Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erl HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding&apos;s Dissertation RFC 1945: HTTP/1. + + cow_cookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie/ + Name cow_cookie - Cookies +Description The module cow_cookie provides functions for parsing and manipulating cookie headers. +Exports cow_cookie:parse_cookie(3) - Parse a cookie header cow_cookie:setcookie(3) - Generate a set-cookie header Types cookie_opts() cookie_opts() :: [Option] Option :: {domain, binary()} | {http_only, boolean()} | {max_age, non_neg_integer()} | {path, binary()} | {same_site, lax | strict} | {secure, boolean()} Options for the set-cookie header. They are added to the header as attributes. + + + + cow_cookie:parse_cookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/ + Name cow_cookie:parse_cookie - Parse a cookie header +Description parse_cookie(Cookie :: binary()) -&gt; [{binary(), binary()}] Parse a cookie header. +Arguments Cookie The cookie header value. + Return value A list of cookie name/value pairs is returned on success. +An exception is thrown in the event of a parse error. +Changelog 1.0: Function introduced. Examples Parse a cookie header Cookies = cow_cookie:parse_cookie(CookieHd). See also cow_cookie(3), cow_cookie:setcookie(3) + + + + cow_cookie:setcookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/ + Name cow_cookie:setcookie - Generate a set-cookie header +Description setcookie(Name :: iodata(), Value :: iodata(), Opts :: cow_cookie:cookie_opts()) -&gt; iolist() Generate a set-cookie header. +Arguments Name Cookie name. + Value Cookie value. + Opts Options added to the set-cookie header as attributes. + Return value An iolist with the generated set-cookie header value. +Changelog 1.0: Function introduced. Examples Generate a set-cookie header SetCookie = cow_cookie:setcookie(&lt;&lt;"sessionid"&gt;&gt;, ID, #{ http_only =&gt; true, secure =&gt; true }). + + Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.2/manual/ @@ -7043,6 +7083,27 @@ Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -&gt; {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -&gt; CallResult %% optional websocket_handle(InFrame, State) -&gt; CallResult websocket_info(Info, State) -&gt; CallResult terminate(Reason, PartialReq, State) -&gt; ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: ping | pong | {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. + + Cowlib Function Reference + https://ninenines.eu/docs/en/cowlib/2.7/manual/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/ + cow_cookie(3) cow_cookie:parse_cookie(3) cow_cookie:setcookie(3) cowlib(7) + + + + cowlib(7) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cowlib_app/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cowlib_app/ + Name cowlib - Support library for manipulating Web protocols +Description Cowlib provides libraries for parsing and building messages for various Web protocols, including HTTP/1.1, HTTP/2 and Websocket. +It is optimized for completeness rather than speed. No value is ignored, they are all returned. +Modules cow_cookie(3) - Cookies Dependencies crypto - Crypto functions All these applications must be started before the cowlib application. To start Cowlib and all dependencies at once: + + Gun Function Reference https://ninenines.eu/docs/en/gun/1.0/manual/ diff --git a/donate/index.html b/donate/index.html index 36d80e67..67c45dfb 100644 --- a/donate/index.html +++ b/donate/index.html @@ -1954,6 +1954,16 @@ + + + + + + + + + + diff --git a/index.html b/index.html index 5d15ef1e..074d12bc 100644 --- a/index.html +++ b/index.html @@ -137,6 +137,8 @@ Source Code + Manual +

    @@ -2077,6 +2079,16 @@ + + + + + + + + + + diff --git a/index.xml b/index.xml index ded72c5a..3df54fc8 100644 --- a/index.xml +++ b/index.xml @@ -3282,6 +3282,46 @@ Writing an algorithm to check for victory sounds easy, right? It&apos;s easi In Erlang though, you probably wouldn&apos;t want an algorithm.
    + + cow_cookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie/ + Name cow_cookie - Cookies +Description The module cow_cookie provides functions for parsing and manipulating cookie headers. +Exports cow_cookie:parse_cookie(3) - Parse a cookie header cow_cookie:setcookie(3) - Generate a set-cookie header Types cookie_opts() cookie_opts() :: [Option] Option :: {domain, binary()} | {http_only, boolean()} | {max_age, non_neg_integer()} | {path, binary()} | {same_site, lax | strict} | {secure, boolean()} Options for the set-cookie header. They are added to the header as attributes. + + + + cow_cookie:parse_cookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/ + Name cow_cookie:parse_cookie - Parse a cookie header +Description parse_cookie(Cookie :: binary()) -&gt; [{binary(), binary()}] Parse a cookie header. +Arguments Cookie The cookie header value. + Return value A list of cookie name/value pairs is returned on success. +An exception is thrown in the event of a parse error. +Changelog 1.0: Function introduced. Examples Parse a cookie header Cookies = cow_cookie:parse_cookie(CookieHd). See also cow_cookie(3), cow_cookie:setcookie(3) + + + + cow_cookie:setcookie(3) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/ + Name cow_cookie:setcookie - Generate a set-cookie header +Description setcookie(Name :: iodata(), Value :: iodata(), Opts :: cow_cookie:cookie_opts()) -&gt; iolist() Generate a set-cookie header. +Arguments Name Cookie name. + Value Cookie value. + Opts Options added to the set-cookie header as attributes. + Return value An iolist with the generated set-cookie header value. +Changelog 1.0: Function introduced. Examples Generate a set-cookie header SetCookie = cow_cookie:setcookie(&lt;&lt;"sessionid"&gt;&gt;, ID, #{ http_only =&gt; true, secure =&gt; true }). + + Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.2/manual/ @@ -7593,6 +7633,27 @@ Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -&gt; {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -&gt; CallResult %% optional websocket_handle(InFrame, State) -&gt; CallResult websocket_info(Info, State) -&gt; CallResult terminate(Reason, PartialReq, State) -&gt; ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: ping | pong | {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. + + Cowlib Function Reference + https://ninenines.eu/docs/en/cowlib/2.7/manual/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/ + cow_cookie(3) cow_cookie:parse_cookie(3) cow_cookie:setcookie(3) cowlib(7) + + + + cowlib(7) + https://ninenines.eu/docs/en/cowlib/2.7/manual/cowlib_app/ + Mon, 01 Jan 0001 00:00:00 +0000 + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cowlib_app/ + Name cowlib - Support library for manipulating Web protocols +Description Cowlib provides libraries for parsing and building messages for various Web protocols, including HTTP/1.1, HTTP/2 and Websocket. +It is optimized for completeness rather than speed. No value is ignored, they are all returned. +Modules cow_cookie(3) - Cookies Dependencies crypto - Crypto functions All these applications must be started before the cowlib application. To start Cowlib and all dependencies at once: + + Gun Function Reference https://ninenines.eu/docs/en/gun/1.0/manual/ diff --git a/services/index.html b/services/index.html index a1440149..0f54d8a3 100644 --- a/services/index.html +++ b/services/index.html @@ -1980,6 +1980,16 @@ + + + + + + + + + + diff --git a/sitemap.xml b/sitemap.xml index cf42a183..b8354895 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -1249,6 +1249,18 @@ https://ninenines.eu/categories/ + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie/ + + + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.parse_cookie/ + + + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cow_cookie.setcookie/ + + https://ninenines.eu/docs/en/cowboy/2.2/manual/ @@ -2613,6 +2625,14 @@ https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_websocket/ + + https://ninenines.eu/docs/en/cowlib/2.7/manual/ + + + + https://ninenines.eu/docs/en/cowlib/2.7/manual/cowlib_app/ + + https://ninenines.eu/docs/ -- cgit v1.2.3