diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-02-16 12:23:23 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2015-02-16 12:23:41 +0200 |
commit | ab643e782b45d6a53994cdd401227fe34168ac2f (patch) | |
tree | d0c3e9e0918e6f93a86ed5902f368695321ce054 | |
parent | 429f9d75c1f6bad9a71fe77351333195859478d2 (diff) | |
download | vmod-variable-ab643e782b45d6a53994cdd401227fe34168ac2f.tar.gz vmod-variable-ab643e782b45d6a53994cdd401227fe34168ac2f.tar.bz2 |
Update docs
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | src/vmod-variable.3 | 31 |
2 files changed, 31 insertions, 2 deletions
@@ -15,7 +15,7 @@ the section "vmod_variable vs. vmod_var". | |||
15 | 15 | ||
16 | * Overview | 16 | * Overview |
17 | 17 | ||
18 | This module provides extended variable support for VCL scripts. | 18 | This module provides enhanced variable support for VCL scripts. |
19 | It compiles for Varnish versions 3 and 4. | 19 | It compiles for Varnish versions 3 and 4. |
20 | 20 | ||
21 | There are two kinds of variables: session-specific, which have the | 21 | There are two kinds of variables: session-specific, which have the |
diff --git a/src/vmod-variable.3 b/src/vmod-variable.3 index 6e4f8b6..5d5467d 100644 --- a/src/vmod-variable.3 +++ b/src/vmod-variable.3 | |||
@@ -21,7 +21,7 @@ vmod-variable \- variable support for Varnish Cache | |||
21 | \fBimport variable\fR [\fIPATH\fR]\fB;\fR | 21 | \fBimport variable\fR [\fIPATH\fR]\fB;\fR |
22 | 22 | ||
23 | .SH DESCRIPTION | 23 | .SH DESCRIPTION |
24 | This module provides extended variable support for \fBVCL\fR scripts. | 24 | This module provides enhanced variable support for \fBVCL\fR scripts. |
25 | .PP | 25 | .PP |
26 | There are two kind of variables: \fIsession-specific\fR and \fIglobal\fR. | 26 | There are two kind of variables: \fIsession-specific\fR and \fIglobal\fR. |
27 | Session-specific variables have a lifespan of one HTTP session and cease to | 27 | Session-specific variables have a lifespan of one HTTP session and cease to |
@@ -43,8 +43,36 @@ sets the variables defined in it. | |||
43 | .PP | 43 | .PP |
44 | The \fIglobal\fR variables are shared between all threads and sessions. They | 44 | The \fIglobal\fR variables are shared between all threads and sessions. They |
45 | can hold only string values. | 45 | can hold only string values. |
46 | .SH VMOD_VARIABLE VS. VMOD_VAR | ||
47 | This module doesn't share any code with \fBvmod_var\fR. Compared with | ||
48 | the latter, it provides the following new features: | ||
49 | .PP | ||
50 | .nr step 1 1 | ||
51 | .IP \n[step]. | ||
52 | Both Varsnish 3 and 4 are supported; | ||
53 | .IP \n+[step]. | ||
54 | Variables are stored in hash tables with open addressing, to | ||
55 | speed up accesses (\fBvmod_var\fR keeps them in singly-linked lists). | ||
56 | .IP \n+[step]. | ||
57 | Functions for testing existence and types of variables, and for | ||
58 | unsetting a variable: | ||
59 | .BR defined() , | ||
60 | .BR type_of() ", and" | ||
61 | .BR unset() . | ||
62 | .IP \n+[step]. | ||
63 | The \fBregset()\fR and \fBqueryset()\fR functions. | ||
64 | .IP \n+[step]. | ||
65 | Additional functions for global variables: | ||
66 | .BR global_clear() , | ||
67 | .BR global_defined() ", and" | ||
68 | .BR global_unset() . | ||
69 | .PP | ||
70 | To facilitate transition, \fBvmod_variable\fR uses the same naming | ||
71 | scheme as \fBvmod_var\fR, so switching to using it in your VCL script | ||
72 | is as simple as replacing \fBs/var\\./variable./\fR. | ||
46 | .SH FUNCTIONS | 73 | .SH FUNCTIONS |
47 | The function below operate on session-local variables. | 74 | The function below operate on session-local variables. |
75 | .PP | ||
48 | .TP | 76 | .TP |
49 | \fBVOID set(STRING \fIname\fB, STRING \fIvalue\fB)\fR | 77 | \fBVOID set(STRING \fIname\fB, STRING \fIvalue\fB)\fR |
50 | Assigns \fIvalue\fR to the string variable \fIname\fR. | 78 | Assigns \fIvalue\fR to the string variable \fIname\fR. |
@@ -147,6 +175,7 @@ Unsets the variable \fIname\fR. | |||
147 | .PP | 175 | .PP |
148 | The functions below operate on global variables. Global variables can | 176 | The functions below operate on global variables. Global variables can |
149 | be hold only string values. | 177 | be hold only string values. |
178 | .PP | ||
150 | .TP | 179 | .TP |
151 | \fBVOID global_set(STRING \fIname\fB, STRING \fIvalue\fB)\fR | 180 | \fBVOID global_set(STRING \fIname\fB, STRING \fIvalue\fB)\fR |
152 | Assigns \fIvalue\fR to the global variable \fIname\fR. | 181 | Assigns \fIvalue\fR to the global variable \fIname\fR. |