Commit c6d1800f authored by Nils Goroll's avatar Nils Goroll

check in generated rsts for vmod directory

parent 39a430d3
..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit vmod.vcc and run make instead
..
.. role:: ref(emphasis)
.. _vmod_constant(3):
=============
vmod_constant
=============
-----------------------
Varnish constant Module
-----------------------
:Manual section: 3
SYNOPSIS
========
::
import constant [from "path"] ;
new xacl = constant.acl([ACL init])
ACL xacl.get(ACL fallback)
BOOL xacl.defined()
new xbackend = constant.backend([BACKEND init])
BACKEND xbackend.get(BACKEND fallback)
BOOL xbackend.defined()
new xblob = constant.blob([BLOB init])
BLOB xblob.get(BLOB fallback)
BOOL xblob.defined()
new xbody = constant.body([BODY init])
BODY xbody.get(BODY fallback)
BOOL xbody.defined()
new xbool = constant.bool([BOOL init])
BOOL xbool.get(BOOL fallback)
BOOL xbool.defined()
new xbytes = constant.bytes([BYTES init])
BYTES xbytes.get(BYTES fallback)
BOOL xbytes.defined()
new xduration = constant.duration([DURATION init])
DURATION xduration.get(DURATION fallback)
BOOL xduration.defined()
new xheader = constant.header([HEADER init])
HEADER xheader.get(HEADER fallback)
BOOL xheader.defined()
new xint = constant.int([INT init])
INT xint.get(INT fallback)
BOOL xint.defined()
new xip = constant.ip([IP init])
IP xip.get(IP fallback)
BOOL xip.defined()
new xprobe = constant.probe([PROBE init])
PROBE xprobe.get(PROBE fallback)
BOOL xprobe.defined()
new xreal = constant.real([REAL init])
REAL xreal.get(REAL fallback)
BOOL xreal.defined()
new xstevedore = constant.stevedore([STEVEDORE init])
STEVEDORE xstevedore.get(STEVEDORE fallback)
BOOL xstevedore.defined()
new xstring = constant.string([STRING init])
STRING xstring.get(STRING fallback)
BOOL xstring.defined()
new xtime = constant.time([TIME init])
TIME xtime.get(TIME fallback)
BOOL xtime.defined()
DESCRIPTION
===========
This module implements globally (per vcl) scoped constants as objects:
All vcl subroutines have the same view on constants.
The value of a constant is the value assigned to it at construction
time, if any.
constants can be undefined. Attempts to ``.get`` an undefined value
will return a the ``.get`` method`s `fallback` argument, which in turn
may have a default for some cases.
Example::
import constant;
sub vcl_init {
new xint = constant.int(42);
new xundef = constant.int();
}
sub vcl_recv {
set req.http.def = xundef.defined(); # false
set req.http.fallback = xundef.get(5); # 5
}
sub vcl_deliver {
set resp.http.the-answer = xint.get(); # 42
}
The implementation of the various classes of this vmod is
auto-generated, and so is the documentation. Thus, the documentation
following this generic description is identical for all types except
for the respective type names and the ``.get()`` fallback.
.. just a newline
CONTENTS
========
* :ref:`obj_acl`
* :ref:`func_acl.defined`
* :ref:`func_acl.get`
* :ref:`obj_backend`
* :ref:`func_backend.defined`
* :ref:`func_backend.get`
* :ref:`obj_blob`
* :ref:`func_blob.defined`
* :ref:`func_blob.get`
* :ref:`obj_body`
* :ref:`func_body.defined`
* :ref:`func_body.get`
* :ref:`obj_bool`
* :ref:`func_bool.defined`
* :ref:`func_bool.get`
* :ref:`obj_bytes`
* :ref:`func_bytes.defined`
* :ref:`func_bytes.get`
* :ref:`obj_duration`
* :ref:`func_duration.defined`
* :ref:`func_duration.get`
* :ref:`obj_header`
* :ref:`func_header.defined`
* :ref:`func_header.get`
* :ref:`obj_int`
* :ref:`func_int.defined`
* :ref:`func_int.get`
* :ref:`obj_ip`
* :ref:`func_ip.defined`
* :ref:`func_ip.get`
* :ref:`obj_probe`
* :ref:`func_probe.defined`
* :ref:`func_probe.get`
* :ref:`obj_real`
* :ref:`func_real.defined`
* :ref:`func_real.get`
* :ref:`obj_stevedore`
* :ref:`func_stevedore.defined`
* :ref:`func_stevedore.get`
* :ref:`obj_string`
* :ref:`func_string.defined`
* :ref:`func_string.get`
* :ref:`obj_time`
* :ref:`func_time.defined`
* :ref:`func_time.get`
.. _obj_acl:
new xacl = constant.acl([ACL init])
-----------------------------------
Construct a(n) ACL constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_acl.get:
ACL xacl.get(ACL fallback)
--------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_acl.defined:
BOOL xacl.defined()
-------------------
Return whether the constant is defined.
.. _obj_backend:
new xbackend = constant.backend([BACKEND init])
-----------------------------------------------
Construct a(n) BACKEND constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_backend.get:
BACKEND xbackend.get(BACKEND fallback=0)
----------------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is no backend.
.. _func_backend.defined:
BOOL xbackend.defined()
-----------------------
Return whether the constant is defined.
.. _obj_blob:
new xblob = constant.blob([BLOB init])
--------------------------------------
Construct a(n) BLOB constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_blob.get:
BLOB xblob.get(BLOB fallback)
-----------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_blob.defined:
BOOL xblob.defined()
--------------------
Return whether the constant is defined.
.. _obj_body:
new xbody = constant.body([BODY init])
--------------------------------------
Construct a(n) BODY constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_body.get:
BODY xbody.get(BODY fallback)
-----------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_body.defined:
BOOL xbody.defined()
--------------------
Return whether the constant is defined.
.. _obj_bool:
new xbool = constant.bool([BOOL init])
--------------------------------------
Construct a(n) BOOL constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_bool.get:
BOOL xbool.get(BOOL fallback)
-----------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_bool.defined:
BOOL xbool.defined()
--------------------
Return whether the constant is defined.
.. _obj_bytes:
new xbytes = constant.bytes([BYTES init])
-----------------------------------------
Construct a(n) BYTES constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_bytes.get:
BYTES xbytes.get(BYTES fallback)
--------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_bytes.defined:
BOOL xbytes.defined()
---------------------
Return whether the constant is defined.
.. _obj_duration:
new xduration = constant.duration([DURATION init])
--------------------------------------------------
Construct a(n) DURATION constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_duration.get:
DURATION xduration.get(DURATION fallback=0)
-------------------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is 0s.
.. _func_duration.defined:
BOOL xduration.defined()
------------------------
Return whether the constant is defined.
.. _obj_header:
new xheader = constant.header([HEADER init])
--------------------------------------------
Construct a(n) HEADER constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_header.get:
HEADER xheader.get(HEADER fallback)
-----------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_header.defined:
BOOL xheader.defined()
----------------------
Return whether the constant is defined.
.. _obj_int:
new xint = constant.int([INT init])
-----------------------------------
Construct a(n) INT constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_int.get:
INT xint.get(INT fallback=0)
----------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is 0.
.. _func_int.defined:
BOOL xint.defined()
-------------------
Return whether the constant is defined.
.. _obj_ip:
new xip = constant.ip([IP init])
--------------------------------
Construct a(n) IP constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_ip.get:
IP xip.get(IP fallback)
-----------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_ip.defined:
BOOL xip.defined()
------------------
Return whether the constant is defined.
.. _obj_probe:
new xprobe = constant.probe([PROBE init])
-----------------------------------------
Construct a(n) PROBE constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_probe.get:
PROBE xprobe.get(PROBE fallback)
--------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_probe.defined:
BOOL xprobe.defined()
---------------------
Return whether the constant is defined.
.. _obj_real:
new xreal = constant.real([REAL init])
--------------------------------------
Construct a(n) REAL constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_real.get:
REAL xreal.get(REAL fallback=0.0)
---------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is 0.0.
.. _func_real.defined:
BOOL xreal.defined()
--------------------
Return whether the constant is defined.
.. _obj_stevedore:
new xstevedore = constant.stevedore([STEVEDORE init])
-----------------------------------------------------
Construct a(n) STEVEDORE constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_stevedore.get:
STEVEDORE xstevedore.get(STEVEDORE fallback)
--------------------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined.
.. _func_stevedore.defined:
BOOL xstevedore.defined()
-------------------------
Return whether the constant is defined.
.. _obj_string:
new xstring = constant.string([STRING init])
--------------------------------------------
Construct a(n) STRING constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_string.get:
STRING xstring.get(STRING fallback=0)
-------------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is the empty string.
.. _func_string.defined:
BOOL xstring.defined()
----------------------
Return whether the constant is defined.
.. _obj_time:
new xtime = constant.time([TIME init])
--------------------------------------
Construct a(n) TIME constant with the value `init`,
if provided. If no `init` value is provided, the constant
will be undefined.
.. _func_time.get:
TIME xtime.get(TIME fallback=0)
-------------------------------
Return the value of the constant or the `fallback` argument
if it is undefined. The default fallback is the epoch (1970/1/1 0:00:00 GMT).
.. _func_time.defined:
BOOL xtime.defined()
--------------------
Return whether the constant is defined.
SEE ALSO
========
vcl\(7),varnishd\(1)
COPYRIGHT
=========
::
Copyright 2018 UPLEX Nils Goroll Systemoptimierung
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit vmod.vcc and run make instead
..
.. role:: ref(emphasis)
.. _vmod_globalvar(3):
==============
vmod_globalvar
==============
------------------------
Varnish globalvar Module
------------------------
:Manual section: 3
SYNOPSIS
========
::
import globalvar [from "path"] ;
new xacl = globalvar.acl([ACL init])
ACL xacl.get(ACL fallback)
VOID xacl.set(ACL)
VOID xacl.undefine()
BOOL xacl.defined()
new xbackend = globalvar.backend([BACKEND init])
BACKEND xbackend.get(BACKEND fallback)
VOID xbackend.set(BACKEND)
VOID xbackend.undefine()
BOOL xbackend.defined()
new xblob = globalvar.blob([BLOB init])
BLOB xblob.get(BLOB fallback)
VOID xblob.set(BLOB)
VOID xblob.undefine()
BOOL xblob.defined()
new xbody = globalvar.body([BODY init])
BODY xbody.get(BODY fallback)
VOID xbody.set(BODY)
VOID xbody.undefine()
BOOL xbody.defined()
new xbool = globalvar.bool([BOOL init])
BOOL xbool.get(BOOL fallback)
VOID xbool.set(BOOL)
VOID xbool.undefine()
BOOL xbool.defined()
new xbytes = globalvar.bytes([BYTES init])
BYTES xbytes.get(BYTES fallback)
VOID xbytes.set(BYTES)
VOID xbytes.undefine()
BOOL xbytes.defined()
new xduration = globalvar.duration([DURATION init])
DURATION xduration.get(DURATION fallback)
VOID xduration.set(DURATION)
VOID xduration.undefine()
BOOL xduration.defined()
new xheader = globalvar.header([HEADER init])
HEADER xheader.get(HEADER fallback)
VOID xheader.set(HEADER)
VOID xheader.undefine()
BOOL xheader.defined()
new xint = globalvar.int([INT init])
INT xint.get(INT fallback)
VOID xint.set(INT)
VOID xint.undefine()
BOOL xint.defined()
new xip = globalvar.ip([IP init])
IP xip.get(IP fallback)
VOID xip.set(IP)
VOID xip.undefine()
BOOL xip.defined()
new xprobe = globalvar.probe([PROBE init])
PROBE xprobe.get(PROBE fallback)
VOID xprobe.set(PROBE)
VOID xprobe.undefine()
BOOL xprobe.defined()
new xreal = globalvar.real([REAL init])
REAL xreal.get(REAL fallback)
VOID xreal.set(REAL)
VOID xreal.undefine()
BOOL xreal.defined()
new xstevedore = globalvar.stevedore([STEVEDORE init])
STEVEDORE xstevedore.get(STEVEDORE fallback)
VOID xstevedore.set(STEVEDORE)
VOID xstevedore.undefine()
BOOL xstevedore.defined()
new xstring = globalvar.string([STRING init])
STRING xstring.get(STRING fallback)
VOID xstring.set(STRING)
VOID xstring.undefine()
BOOL xstring.defined()
new xtime = globalvar.time([TIME init])
TIME xtime.get(TIME fallback)
VOID xtime.set(TIME)
VOID xtime.undefine()
BOOL xtime.defined()
DESCRIPTION
===========
This module implements globally (per vcl) scoped variables as objects:
All vcl subroutines have the same view on variables, any change comes
in effect immediately.
The value of a globalvar is the value assigned to it by any vcl
subroutine within each vcl or a default provided at construction time,
if any.
globalvars can be undefined. Attempts to ``.get`` an undefined value
will return a the ``.get`` method`s `fallback` argument, which in turn
may have a default for some cases.
Where necessary, read access to globalvar variables is reference
counted using priv_task state, such that changed variables` storage is
not freed before the last access ceased.
Example with an initially undefined variable::
import globalvar;
sub vcl_init {
new xint = globalvar.int();
}
sub vcl_recv {
set req.http.def = xint.defined(); # false
set req.http.fallback = xint.get(5); # 5
xint.set(42);
}
\# in some other request, later
sub vcl_deliver {
set resp.http.the-answer = xint.get(); # 42
}
The implementation of the various classes of this vmod is
auto-generated, and so is the documentation. Thus, the documentation
following this generic description is identical for all types except
for the respective type names and the ``.get()`` fallback.
.. just a newline
CONTENTS
========
* :ref:`obj_acl`
* :ref:`func_acl.defined`
* :ref:`func_acl.get`
* :ref:`func_acl.set`
* :ref:`func_acl.undefine`
* :ref:`obj_backend`
* :ref:`func_backend.defined`
* :ref:`func_backend.get`
* :ref:`func_backend.set`
* :ref:`func_backend.undefine`
* :ref:`obj_blob`
* :ref:`func_blob.defined`
* :ref:`func_blob.get`
* :ref:`func_blob.set`
* :ref:`func_blob.undefine`
* :ref:`obj_body`
* :ref:`func_body.defined`
* :ref:`func_body.get`
* :ref:`func_body.set`
* :ref:`func_body.undefine`
* :ref:`obj_bool`
* :ref:`func_bool.defined`
* :ref:`func_bool.get`
* :ref:`func_bool.set`
* :ref:`func_bool.undefine`
* :ref:`obj_bytes`
* :ref:`func_bytes.defined`
* :ref:`func_bytes.get`
* :ref:`func_bytes.set`
* :ref:`func_bytes.undefine`
* :ref:`obj_duration`
* :ref:`func_duration.defined`
* :ref:`func_duration.get`
* :ref:`func_duration.set`
* :ref:`func_duration.undefine`
* :ref:`obj_header`
* :ref:`func_header.defined`
* :ref:`func_header.get`
* :ref:`func_header.set`
* :ref:`func_header.undefine`
* :ref:`obj_int`
* :ref:`func_int.defined`
* :ref:`func_int.get`
* :ref:`func_int.set`
* :ref:`func_int.undefine`
* :ref:`obj_ip`
* :ref:`func_ip.defined`
* :ref:`func_ip.get`
* :ref:`func_ip.set`
* :ref:`func_ip.undefine`
* :ref:`obj_probe`
* :ref:`func_probe.defined`
* :ref:`func_probe.get`
* :ref:`func_probe.set`
* :ref:`func_probe.undefine`
* :ref:`obj_real`
* :ref:`func_real.defined`
* :ref:`func_real.get`
* :ref:`func_real.set`
* :ref:`func_real.undefine`
* :ref:`obj_stevedore`
* :ref:`func_stevedore.defined`
* :ref:`func_stevedore.get`
* :ref:`func_stevedore.set`
* :ref:`func_stevedore.undefine`
* :ref:`obj_string`
* :ref:`func_string.defined`
* :ref:`func_string.get`
* :ref:`func_string.set`
* :ref:`func_string.undefine`
* :ref:`obj_time`
* :ref:`func_time.defined`
* :ref:`func_time.get`
* :ref:`func_time.set`
* :ref:`func_time.undefine`
.. _obj_acl:
new xacl = globalvar.acl([ACL init])
------------------------------------
Construct a(n) ACL globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_acl.get:
ACL xacl.get(ACL fallback)
--------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_acl.set:
VOID xacl.set(ACL)
------------------
Set the value of the globalvar.
.. _func_acl.undefine:
VOID xacl.undefine()
--------------------
Undefine the globalvar.
.. _func_acl.defined:
BOOL xacl.defined()
-------------------
Return whether the globalvar is defined.
.. _obj_backend:
new xbackend = globalvar.backend([BACKEND init])
------------------------------------------------
Construct a(n) BACKEND globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_backend.get:
BACKEND xbackend.get(BACKEND fallback=0)
----------------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is no backend.
.. _func_backend.set:
VOID xbackend.set(BACKEND)
--------------------------
Set the value of the globalvar.
.. _func_backend.undefine:
VOID xbackend.undefine()
------------------------
Undefine the globalvar.
.. _func_backend.defined:
BOOL xbackend.defined()
-----------------------
Return whether the globalvar is defined.
.. _obj_blob:
new xblob = globalvar.blob([BLOB init])
---------------------------------------
Construct a(n) BLOB globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_blob.get:
BLOB xblob.get(BLOB fallback)
-----------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_blob.set:
VOID xblob.set(BLOB)
--------------------
Set the value of the globalvar.
.. _func_blob.undefine:
VOID xblob.undefine()
---------------------
Undefine the globalvar.
.. _func_blob.defined:
BOOL xblob.defined()
--------------------
Return whether the globalvar is defined.
.. _obj_body:
new xbody = globalvar.body([BODY init])
---------------------------------------
Construct a(n) BODY globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_body.get:
BODY xbody.get(BODY fallback)
-----------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_body.set:
VOID xbody.set(BODY)
--------------------
Set the value of the globalvar.
.. _func_body.undefine:
VOID xbody.undefine()
---------------------
Undefine the globalvar.
.. _func_body.defined:
BOOL xbody.defined()
--------------------
Return whether the globalvar is defined.
.. _obj_bool:
new xbool = globalvar.bool([BOOL init])
---------------------------------------
Construct a(n) BOOL globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bool.get:
BOOL xbool.get(BOOL fallback)
-----------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_bool.set:
VOID xbool.set(BOOL)
--------------------
Set the value of the globalvar.
.. _func_bool.undefine:
VOID xbool.undefine()
---------------------
Undefine the globalvar.
.. _func_bool.defined:
BOOL xbool.defined()
--------------------
Return whether the globalvar is defined.
.. _obj_bytes:
new xbytes = globalvar.bytes([BYTES init])
------------------------------------------
Construct a(n) BYTES globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bytes.get:
BYTES xbytes.get(BYTES fallback)
--------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_bytes.set:
VOID xbytes.set(BYTES)
----------------------
Set the value of the globalvar.
.. _func_bytes.undefine:
VOID xbytes.undefine()
----------------------
Undefine the globalvar.
.. _func_bytes.defined:
BOOL xbytes.defined()
---------------------
Return whether the globalvar is defined.
.. _obj_duration:
new xduration = globalvar.duration([DURATION init])
---------------------------------------------------
Construct a(n) DURATION globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_duration.get:
DURATION xduration.get(DURATION fallback=0)
-------------------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is 0s.
.. _func_duration.set:
VOID xduration.set(DURATION)
----------------------------
Set the value of the globalvar.
.. _func_duration.undefine:
VOID xduration.undefine()
-------------------------
Undefine the globalvar.
.. _func_duration.defined:
BOOL xduration.defined()
------------------------
Return whether the globalvar is defined.
.. _obj_header:
new xheader = globalvar.header([HEADER init])
---------------------------------------------
Construct a(n) HEADER globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_header.get:
HEADER xheader.get(HEADER fallback)
-----------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_header.set:
VOID xheader.set(HEADER)
------------------------
Set the value of the globalvar.
.. _func_header.undefine:
VOID xheader.undefine()
-----------------------
Undefine the globalvar.
.. _func_header.defined:
BOOL xheader.defined()
----------------------
Return whether the globalvar is defined.
.. _obj_int:
new xint = globalvar.int([INT init])
------------------------------------
Construct a(n) INT globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_int.get:
INT xint.get(INT fallback=0)
----------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is 0.
.. _func_int.set:
VOID xint.set(INT)
------------------
Set the value of the globalvar.
.. _func_int.undefine:
VOID xint.undefine()
--------------------
Undefine the globalvar.
.. _func_int.defined:
BOOL xint.defined()
-------------------
Return whether the globalvar is defined.
.. _obj_ip:
new xip = globalvar.ip([IP init])
---------------------------------
Construct a(n) IP globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_ip.get:
IP xip.get(IP fallback)
-----------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_ip.set:
VOID xip.set(IP)
----------------
Set the value of the globalvar.
.. _func_ip.undefine:
VOID xip.undefine()
-------------------
Undefine the globalvar.
.. _func_ip.defined:
BOOL xip.defined()
------------------
Return whether the globalvar is defined.
.. _obj_probe:
new xprobe = globalvar.probe([PROBE init])
------------------------------------------
Construct a(n) PROBE globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_probe.get:
PROBE xprobe.get(PROBE fallback)
--------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_probe.set:
VOID xprobe.set(PROBE)
----------------------
Set the value of the globalvar.
.. _func_probe.undefine:
VOID xprobe.undefine()
----------------------
Undefine the globalvar.
.. _func_probe.defined:
BOOL xprobe.defined()
---------------------
Return whether the globalvar is defined.
.. _obj_real:
new xreal = globalvar.real([REAL init])
---------------------------------------
Construct a(n) REAL globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_real.get:
REAL xreal.get(REAL fallback=0.0)
---------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is 0.0.
.. _func_real.set:
VOID xreal.set(REAL)
--------------------
Set the value of the globalvar.
.. _func_real.undefine:
VOID xreal.undefine()
---------------------
Undefine the globalvar.
.. _func_real.defined:
BOOL xreal.defined()
--------------------
Return whether the globalvar is defined.
.. _obj_stevedore:
new xstevedore = globalvar.stevedore([STEVEDORE init])
------------------------------------------------------
Construct a(n) STEVEDORE globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_stevedore.get:
STEVEDORE xstevedore.get(STEVEDORE fallback)
--------------------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined.
.. _func_stevedore.set:
VOID xstevedore.set(STEVEDORE)
------------------------------
Set the value of the globalvar.
.. _func_stevedore.undefine:
VOID xstevedore.undefine()
--------------------------
Undefine the globalvar.
.. _func_stevedore.defined:
BOOL xstevedore.defined()
-------------------------
Return whether the globalvar is defined.
.. _obj_string:
new xstring = globalvar.string([STRING init])
---------------------------------------------
Construct a(n) STRING globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_string.get:
STRING xstring.get(STRING fallback=0)
-------------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is the empty string.
.. _func_string.set:
VOID xstring.set(STRING)
------------------------
Set the value of the globalvar.
.. _func_string.undefine:
VOID xstring.undefine()
-----------------------
Undefine the globalvar.
.. _func_string.defined:
BOOL xstring.defined()
----------------------
Return whether the globalvar is defined.
.. _obj_time:
new xtime = globalvar.time([TIME init])
---------------------------------------
Construct a(n) TIME globalvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_time.get:
TIME xtime.get(TIME fallback=0)
-------------------------------
Return the value of the globalvar or the `fallback` argument
if it is undefined. The default fallback is the epoch (1970/1/1 0:00:00 GMT).
.. _func_time.set:
VOID xtime.set(TIME)
--------------------
Set the value of the globalvar.
.. _func_time.undefine:
VOID xtime.undefine()
---------------------
Undefine the globalvar.
.. _func_time.defined:
BOOL xtime.defined()
--------------------
Return whether the globalvar is defined.
SEE ALSO
========
vcl\(7),varnishd\(1)
COPYRIGHT
=========
::
Copyright 2018 UPLEX Nils Goroll Systemoptimierung
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit vmod.vcc and run make instead
..
.. role:: ref(emphasis)
.. _vmod_taskvar(3):
============
vmod_taskvar
============
----------------------
Varnish taskvar Module
----------------------
:Manual section: 3
SYNOPSIS
========
::
import taskvar [from "path"] ;
new xacl = taskvar.acl([ACL init])
ACL xacl.get(ACL fallback)
VOID xacl.set(ACL)
VOID xacl.undefine()
BOOL xacl.defined()
VOID xacl.protect()
BOOL xacl.protected()
new xbackend = taskvar.backend([BACKEND init])
BACKEND xbackend.get(BACKEND fallback)
VOID xbackend.set(BACKEND)
VOID xbackend.undefine()
BOOL xbackend.defined()
VOID xbackend.protect()
BOOL xbackend.protected()
new xblob = taskvar.blob([BLOB init])
BLOB xblob.get(BLOB fallback)
VOID xblob.set(BLOB)
VOID xblob.undefine()
BOOL xblob.defined()
VOID xblob.protect()
BOOL xblob.protected()
new xbody = taskvar.body([BODY init])
BODY xbody.get(BODY fallback)
VOID xbody.set(BODY)
VOID xbody.undefine()
BOOL xbody.defined()
VOID xbody.protect()
BOOL xbody.protected()
new xbool = taskvar.bool([BOOL init])
BOOL xbool.get(BOOL fallback)
VOID xbool.set(BOOL)
VOID xbool.undefine()
BOOL xbool.defined()
VOID xbool.protect()
BOOL xbool.protected()
new xbytes = taskvar.bytes([BYTES init])
BYTES xbytes.get(BYTES fallback)
VOID xbytes.set(BYTES)
VOID xbytes.undefine()
BOOL xbytes.defined()
VOID xbytes.protect()
BOOL xbytes.protected()
new xduration = taskvar.duration([DURATION init])
DURATION xduration.get(DURATION fallback)
VOID xduration.set(DURATION)
VOID xduration.undefine()
BOOL xduration.defined()
VOID xduration.protect()
BOOL xduration.protected()
new xheader = taskvar.header([HEADER init])
HEADER xheader.get(HEADER fallback)
VOID xheader.set(HEADER)
VOID xheader.undefine()
BOOL xheader.defined()
VOID xheader.protect()
BOOL xheader.protected()
new xint = taskvar.int([INT init])
INT xint.get(INT fallback)
VOID xint.set(INT)
VOID xint.undefine()
BOOL xint.defined()
VOID xint.protect()
BOOL xint.protected()
new xip = taskvar.ip([IP init])
IP xip.get(IP fallback)
VOID xip.set(IP)
VOID xip.undefine()
BOOL xip.defined()
VOID xip.protect()
BOOL xip.protected()
new xprobe = taskvar.probe([PROBE init])
PROBE xprobe.get(PROBE fallback)
VOID xprobe.set(PROBE)
VOID xprobe.undefine()
BOOL xprobe.defined()
VOID xprobe.protect()
BOOL xprobe.protected()
new xreal = taskvar.real([REAL init])
REAL xreal.get(REAL fallback)
VOID xreal.set(REAL)
VOID xreal.undefine()
BOOL xreal.defined()
VOID xreal.protect()
BOOL xreal.protected()
new xstevedore = taskvar.stevedore([STEVEDORE init])
STEVEDORE xstevedore.get(STEVEDORE fallback)
VOID xstevedore.set(STEVEDORE)
VOID xstevedore.undefine()
BOOL xstevedore.defined()
VOID xstevedore.protect()
BOOL xstevedore.protected()
new xstring = taskvar.string([STRING init])
STRING xstring.get(STRING fallback)
VOID xstring.set(STRING)
VOID xstring.undefine()
BOOL xstring.defined()
VOID xstring.protect()
BOOL xstring.protected()
new xtime = taskvar.time([TIME init])
TIME xtime.get(TIME fallback)
VOID xtime.set(TIME)
VOID xtime.undefine()
BOOL xtime.defined()
VOID xtime.protect()
BOOL xtime.protected()
DESCRIPTION
===========
This module implements `task` scoped variables as objects: Each client
or backend request (`task`) has their own view of taskvar variables.
The value of a taskvar is the value assigned to it within a `task` or
a default provided at construction time, if any.
taskvars can be undefined. Attempts to ``.get`` an undefined value
will return a the ``.get`` method`s `fallback` argument, which in turn
may have a default for some cases.
taskvar variables can be protected against write access, in which case
any attempt to set them triggers a VCL failure at runtime.
Example with an initially undefined variable::
import taskvar;
sub vcl_init {
new xint = taskvar.int();
}
sub vcl_recv {
set req.http.def = xint.defined(); # false
set req.http.fallback = xint.get(5); # 5
xint.set(42);
}
sub vcl_deliver {
set resp.http.the-answer = xint.get(); # 42
}
Example with an initially defined variable::
import taskvar;
sub vcl_init {
new xint = taskvar.int(17);
}
sub vcl_recv {
set req.http.def = xint.defined(); # true
set req.http.fallback = xint.get(5); # 17
xint.set(42);
xint.protect();
if (false) {
xint.set(3); # would fail
}
}
sub vcl_deliver {
set resp.http.the-answer = xint.get(); # 42
}
The implementation of the various classes of this vmod is
auto-generated, and so is the documentation. Thus, the documentation
following this generic description is identical for all types except
for the respective type names and the ``.get()`` fallback.
.. just a newline
CONTENTS
========
* :ref:`obj_acl`
* :ref:`func_acl.defined`
* :ref:`func_acl.get`
* :ref:`func_acl.protect`
* :ref:`func_acl.protected`
* :ref:`func_acl.set`
* :ref:`func_acl.undefine`
* :ref:`obj_backend`
* :ref:`func_backend.defined`
* :ref:`func_backend.get`
* :ref:`func_backend.protect`
* :ref:`func_backend.protected`
* :ref:`func_backend.set`
* :ref:`func_backend.undefine`
* :ref:`obj_blob`
* :ref:`func_blob.defined`
* :ref:`func_blob.get`
* :ref:`func_blob.protect`
* :ref:`func_blob.protected`
* :ref:`func_blob.set`
* :ref:`func_blob.undefine`
* :ref:`obj_body`
* :ref:`func_body.defined`
* :ref:`func_body.get`
* :ref:`func_body.protect`
* :ref:`func_body.protected`
* :ref:`func_body.set`
* :ref:`func_body.undefine`
* :ref:`obj_bool`
* :ref:`func_bool.defined`
* :ref:`func_bool.get`
* :ref:`func_bool.protect`
* :ref:`func_bool.protected`
* :ref:`func_bool.set`
* :ref:`func_bool.undefine`
* :ref:`obj_bytes`
* :ref:`func_bytes.defined`
* :ref:`func_bytes.get`
* :ref:`func_bytes.protect`
* :ref:`func_bytes.protected`
* :ref:`func_bytes.set`
* :ref:`func_bytes.undefine`
* :ref:`obj_duration`
* :ref:`func_duration.defined`
* :ref:`func_duration.get`
* :ref:`func_duration.protect`
* :ref:`func_duration.protected`
* :ref:`func_duration.set`
* :ref:`func_duration.undefine`
* :ref:`obj_header`
* :ref:`func_header.defined`
* :ref:`func_header.get`
* :ref:`func_header.protect`
* :ref:`func_header.protected`
* :ref:`func_header.set`
* :ref:`func_header.undefine`
* :ref:`obj_int`
* :ref:`func_int.defined`
* :ref:`func_int.get`
* :ref:`func_int.protect`
* :ref:`func_int.protected`
* :ref:`func_int.set`
* :ref:`func_int.undefine`
* :ref:`obj_ip`
* :ref:`func_ip.defined`
* :ref:`func_ip.get`
* :ref:`func_ip.protect`
* :ref:`func_ip.protected`
* :ref:`func_ip.set`
* :ref:`func_ip.undefine`
* :ref:`obj_probe`
* :ref:`func_probe.defined`
* :ref:`func_probe.get`
* :ref:`func_probe.protect`
* :ref:`func_probe.protected`
* :ref:`func_probe.set`
* :ref:`func_probe.undefine`
* :ref:`obj_real`
* :ref:`func_real.defined`
* :ref:`func_real.get`
* :ref:`func_real.protect`
* :ref:`func_real.protected`
* :ref:`func_real.set`
* :ref:`func_real.undefine`
* :ref:`obj_stevedore`
* :ref:`func_stevedore.defined`
* :ref:`func_stevedore.get`
* :ref:`func_stevedore.protect`
* :ref:`func_stevedore.protected`
* :ref:`func_stevedore.set`
* :ref:`func_stevedore.undefine`
* :ref:`obj_string`
* :ref:`func_string.defined`
* :ref:`func_string.get`
* :ref:`func_string.protect`
* :ref:`func_string.protected`
* :ref:`func_string.set`
* :ref:`func_string.undefine`
* :ref:`obj_time`
* :ref:`func_time.defined`
* :ref:`func_time.get`
* :ref:`func_time.protect`
* :ref:`func_time.protected`
* :ref:`func_time.set`
* :ref:`func_time.undefine`
.. _obj_acl:
new xacl = taskvar.acl([ACL init])
----------------------------------
Construct a(n) ACL taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_acl.get:
ACL xacl.get(ACL fallback)
--------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_acl.set:
VOID xacl.set(ACL)
------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_acl.undefine:
VOID xacl.undefine()
--------------------
Undefine the taskvar.
.. _func_acl.defined:
BOOL xacl.defined()
-------------------
Return whether the taskvar is defined.
.. _func_acl.protect:
VOID xacl.protect()
-------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_acl.protected:
BOOL xacl.protected()
---------------------
Return whether the taskvar is protected.
.. _obj_backend:
new xbackend = taskvar.backend([BACKEND init])
----------------------------------------------
Construct a(n) BACKEND taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_backend.get:
BACKEND xbackend.get(BACKEND fallback=0)
----------------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is no backend.
.. _func_backend.set:
VOID xbackend.set(BACKEND)
--------------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_backend.undefine:
VOID xbackend.undefine()
------------------------
Undefine the taskvar.
.. _func_backend.defined:
BOOL xbackend.defined()
-----------------------
Return whether the taskvar is defined.
.. _func_backend.protect:
VOID xbackend.protect()
-----------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_backend.protected:
BOOL xbackend.protected()
-------------------------
Return whether the taskvar is protected.
.. _obj_blob:
new xblob = taskvar.blob([BLOB init])
-------------------------------------
Construct a(n) BLOB taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_blob.get:
BLOB xblob.get(BLOB fallback)
-----------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_blob.set:
VOID xblob.set(BLOB)
--------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_blob.undefine:
VOID xblob.undefine()
---------------------
Undefine the taskvar.
.. _func_blob.defined:
BOOL xblob.defined()
--------------------
Return whether the taskvar is defined.
.. _func_blob.protect:
VOID xblob.protect()
--------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_blob.protected:
BOOL xblob.protected()
----------------------
Return whether the taskvar is protected.
.. _obj_body:
new xbody = taskvar.body([BODY init])
-------------------------------------
Construct a(n) BODY taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_body.get:
BODY xbody.get(BODY fallback)
-----------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_body.set:
VOID xbody.set(BODY)
--------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_body.undefine:
VOID xbody.undefine()
---------------------
Undefine the taskvar.
.. _func_body.defined:
BOOL xbody.defined()
--------------------
Return whether the taskvar is defined.
.. _func_body.protect:
VOID xbody.protect()
--------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_body.protected:
BOOL xbody.protected()
----------------------
Return whether the taskvar is protected.
.. _obj_bool:
new xbool = taskvar.bool([BOOL init])
-------------------------------------
Construct a(n) BOOL taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bool.get:
BOOL xbool.get(BOOL fallback)
-----------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_bool.set:
VOID xbool.set(BOOL)
--------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_bool.undefine:
VOID xbool.undefine()
---------------------
Undefine the taskvar.
.. _func_bool.defined:
BOOL xbool.defined()
--------------------
Return whether the taskvar is defined.
.. _func_bool.protect:
VOID xbool.protect()
--------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_bool.protected:
BOOL xbool.protected()
----------------------
Return whether the taskvar is protected.
.. _obj_bytes:
new xbytes = taskvar.bytes([BYTES init])
----------------------------------------
Construct a(n) BYTES taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bytes.get:
BYTES xbytes.get(BYTES fallback)
--------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_bytes.set:
VOID xbytes.set(BYTES)
----------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_bytes.undefine:
VOID xbytes.undefine()
----------------------
Undefine the taskvar.
.. _func_bytes.defined:
BOOL xbytes.defined()
---------------------
Return whether the taskvar is defined.
.. _func_bytes.protect:
VOID xbytes.protect()
---------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_bytes.protected:
BOOL xbytes.protected()
-----------------------
Return whether the taskvar is protected.
.. _obj_duration:
new xduration = taskvar.duration([DURATION init])
-------------------------------------------------
Construct a(n) DURATION taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_duration.get:
DURATION xduration.get(DURATION fallback=0)
-------------------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is 0s.
.. _func_duration.set:
VOID xduration.set(DURATION)
----------------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_duration.undefine:
VOID xduration.undefine()
-------------------------
Undefine the taskvar.
.. _func_duration.defined:
BOOL xduration.defined()
------------------------
Return whether the taskvar is defined.
.. _func_duration.protect:
VOID xduration.protect()
------------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_duration.protected:
BOOL xduration.protected()
--------------------------
Return whether the taskvar is protected.
.. _obj_header:
new xheader = taskvar.header([HEADER init])
-------------------------------------------
Construct a(n) HEADER taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_header.get:
HEADER xheader.get(HEADER fallback)
-----------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_header.set:
VOID xheader.set(HEADER)
------------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_header.undefine:
VOID xheader.undefine()
-----------------------
Undefine the taskvar.
.. _func_header.defined:
BOOL xheader.defined()
----------------------
Return whether the taskvar is defined.
.. _func_header.protect:
VOID xheader.protect()
----------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_header.protected:
BOOL xheader.protected()
------------------------
Return whether the taskvar is protected.
.. _obj_int:
new xint = taskvar.int([INT init])
----------------------------------
Construct a(n) INT taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_int.get:
INT xint.get(INT fallback=0)
----------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is 0.
.. _func_int.set:
VOID xint.set(INT)
------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_int.undefine:
VOID xint.undefine()
--------------------
Undefine the taskvar.
.. _func_int.defined:
BOOL xint.defined()
-------------------
Return whether the taskvar is defined.
.. _func_int.protect:
VOID xint.protect()
-------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_int.protected:
BOOL xint.protected()
---------------------
Return whether the taskvar is protected.
.. _obj_ip:
new xip = taskvar.ip([IP init])
-------------------------------
Construct a(n) IP taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_ip.get:
IP xip.get(IP fallback)
-----------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_ip.set:
VOID xip.set(IP)
----------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_ip.undefine:
VOID xip.undefine()
-------------------
Undefine the taskvar.
.. _func_ip.defined:
BOOL xip.defined()
------------------
Return whether the taskvar is defined.
.. _func_ip.protect:
VOID xip.protect()
------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_ip.protected:
BOOL xip.protected()
--------------------
Return whether the taskvar is protected.
.. _obj_probe:
new xprobe = taskvar.probe([PROBE init])
----------------------------------------
Construct a(n) PROBE taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_probe.get:
PROBE xprobe.get(PROBE fallback)
--------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_probe.set:
VOID xprobe.set(PROBE)
----------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_probe.undefine:
VOID xprobe.undefine()
----------------------
Undefine the taskvar.
.. _func_probe.defined:
BOOL xprobe.defined()
---------------------
Return whether the taskvar is defined.
.. _func_probe.protect:
VOID xprobe.protect()
---------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_probe.protected:
BOOL xprobe.protected()
-----------------------
Return whether the taskvar is protected.
.. _obj_real:
new xreal = taskvar.real([REAL init])
-------------------------------------
Construct a(n) REAL taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_real.get:
REAL xreal.get(REAL fallback=0.0)
---------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is 0.0.
.. _func_real.set:
VOID xreal.set(REAL)
--------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_real.undefine:
VOID xreal.undefine()
---------------------
Undefine the taskvar.
.. _func_real.defined:
BOOL xreal.defined()
--------------------
Return whether the taskvar is defined.
.. _func_real.protect:
VOID xreal.protect()
--------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_real.protected:
BOOL xreal.protected()
----------------------
Return whether the taskvar is protected.
.. _obj_stevedore:
new xstevedore = taskvar.stevedore([STEVEDORE init])
----------------------------------------------------
Construct a(n) STEVEDORE taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_stevedore.get:
STEVEDORE xstevedore.get(STEVEDORE fallback)
--------------------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined.
.. _func_stevedore.set:
VOID xstevedore.set(STEVEDORE)
------------------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_stevedore.undefine:
VOID xstevedore.undefine()
--------------------------
Undefine the taskvar.
.. _func_stevedore.defined:
BOOL xstevedore.defined()
-------------------------
Return whether the taskvar is defined.
.. _func_stevedore.protect:
VOID xstevedore.protect()
-------------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_stevedore.protected:
BOOL xstevedore.protected()
---------------------------
Return whether the taskvar is protected.
.. _obj_string:
new xstring = taskvar.string([STRING init])
-------------------------------------------
Construct a(n) STRING taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_string.get:
STRING xstring.get(STRING fallback=0)
-------------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is the empty string.
.. _func_string.set:
VOID xstring.set(STRING)
------------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_string.undefine:
VOID xstring.undefine()
-----------------------
Undefine the taskvar.
.. _func_string.defined:
BOOL xstring.defined()
----------------------
Return whether the taskvar is defined.
.. _func_string.protect:
VOID xstring.protect()
----------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_string.protected:
BOOL xstring.protected()
------------------------
Return whether the taskvar is protected.
.. _obj_time:
new xtime = taskvar.time([TIME init])
-------------------------------------
Construct a(n) TIME taskvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_time.get:
TIME xtime.get(TIME fallback=0)
-------------------------------
Return the value of the taskvar or the `fallback` argument
if it is undefined. The default fallback is the epoch (1970/1/1 0:00:00 GMT).
.. _func_time.set:
VOID xtime.set(TIME)
--------------------
Set the value of the taskvar.
Triggers a vcl failure for protected variables.
.. _func_time.undefine:
VOID xtime.undefine()
---------------------
Undefine the taskvar.
.. _func_time.defined:
BOOL xtime.defined()
--------------------
Return whether the taskvar is defined.
.. _func_time.protect:
VOID xtime.protect()
--------------------
Protect the taskvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_time.protected:
BOOL xtime.protected()
----------------------
Return whether the taskvar is protected.
SEE ALSO
========
vcl\(7),varnishd\(1)
COPYRIGHT
=========
::
Copyright 2018 UPLEX Nils Goroll Systemoptimierung
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
..
.. NB: This file is machine generated, DO NOT EDIT!
..
.. Edit vmod.vcc and run make instead
..
.. role:: ref(emphasis)
.. _vmod_topvar(3):
===========
vmod_topvar
===========
---------------------
Varnish topvar Module
---------------------
:Manual section: 3
SYNOPSIS
========
::
import topvar [from "path"] ;
new xacl = topvar.acl([ACL init])
ACL xacl.get(ACL fallback)
VOID xacl.set(ACL)
VOID xacl.undefine()
BOOL xacl.defined()
VOID xacl.protect()
BOOL xacl.protected()
new xbackend = topvar.backend([BACKEND init])
BACKEND xbackend.get(BACKEND fallback)
VOID xbackend.set(BACKEND)
VOID xbackend.undefine()
BOOL xbackend.defined()
VOID xbackend.protect()
BOOL xbackend.protected()
new xblob = topvar.blob([BLOB init])
BLOB xblob.get(BLOB fallback)
VOID xblob.set(BLOB)
VOID xblob.undefine()
BOOL xblob.defined()
VOID xblob.protect()
BOOL xblob.protected()
new xbody = topvar.body([BODY init])
BODY xbody.get(BODY fallback)
VOID xbody.set(BODY)
VOID xbody.undefine()
BOOL xbody.defined()
VOID xbody.protect()
BOOL xbody.protected()
new xbool = topvar.bool([BOOL init])
BOOL xbool.get(BOOL fallback)
VOID xbool.set(BOOL)
VOID xbool.undefine()
BOOL xbool.defined()
VOID xbool.protect()
BOOL xbool.protected()
new xbytes = topvar.bytes([BYTES init])
BYTES xbytes.get(BYTES fallback)
VOID xbytes.set(BYTES)
VOID xbytes.undefine()
BOOL xbytes.defined()
VOID xbytes.protect()
BOOL xbytes.protected()
new xduration = topvar.duration([DURATION init])
DURATION xduration.get(DURATION fallback)
VOID xduration.set(DURATION)
VOID xduration.undefine()
BOOL xduration.defined()
VOID xduration.protect()
BOOL xduration.protected()
new xheader = topvar.header([HEADER init])
HEADER xheader.get(HEADER fallback)
VOID xheader.set(HEADER)
VOID xheader.undefine()
BOOL xheader.defined()
VOID xheader.protect()
BOOL xheader.protected()
new xint = topvar.int([INT init])
INT xint.get(INT fallback)
VOID xint.set(INT)
VOID xint.undefine()
BOOL xint.defined()
VOID xint.protect()
BOOL xint.protected()
new xip = topvar.ip([IP init])
IP xip.get(IP fallback)
VOID xip.set(IP)
VOID xip.undefine()
BOOL xip.defined()
VOID xip.protect()
BOOL xip.protected()
new xprobe = topvar.probe([PROBE init])
PROBE xprobe.get(PROBE fallback)
VOID xprobe.set(PROBE)
VOID xprobe.undefine()
BOOL xprobe.defined()
VOID xprobe.protect()
BOOL xprobe.protected()
new xreal = topvar.real([REAL init])
REAL xreal.get(REAL fallback)
VOID xreal.set(REAL)
VOID xreal.undefine()
BOOL xreal.defined()
VOID xreal.protect()
BOOL xreal.protected()
new xstevedore = topvar.stevedore([STEVEDORE init])
STEVEDORE xstevedore.get(STEVEDORE fallback)
VOID xstevedore.set(STEVEDORE)
VOID xstevedore.undefine()
BOOL xstevedore.defined()
VOID xstevedore.protect()
BOOL xstevedore.protected()
new xstring = topvar.string([STRING init])
STRING xstring.get(STRING fallback)
VOID xstring.set(STRING)
VOID xstring.undefine()
BOOL xstring.defined()
VOID xstring.protect()
BOOL xstring.protected()
new xtime = topvar.time([TIME init])
TIME xtime.get(TIME fallback)
VOID xtime.set(TIME)
VOID xtime.undefine()
BOOL xtime.defined()
VOID xtime.protect()
BOOL xtime.protected()
DESCRIPTION
===========
This module implements `top` scoped variables as objects: Each client
request including all esi include levels (`top`) has its own view of
topvar variables.
The value of a topvar is the value assigned to it within any esi
subrequest or a default provided at construction time, if any.
topvars can be undefined. Attempts to ``.get`` an undefined value will
return a the ``.get`` method`s `fallback` argument, which in turn may
have a default for some cases.
topvar variables can be protected against write access, in which case
any attempt to set them triggers a VCL failure at runtime.
Example::
import topvar;
sub vcl_init {
new xint = topvar.int();
}
sub vcl_recv {
if (req.esi_level == 0) {
set req.http.def = xint.defined(); # false
set req.http.fallback = xint.get(5); # 5
xint.set(42);
} else {
set req.http.fallback = xint.get(5); #42
}
}
sub vcl_deliver {
set resp.http.the-answer = xint.get(); # 42
}
The implementation of the various classes of this vmod is
auto-generated, and so is the documentation. Thus, the documentation
following this generic description is identical for all types except
for the respective type names and the ``.get()`` fallback.
.. just a newline
CONTENTS
========
* :ref:`obj_acl`
* :ref:`func_acl.defined`
* :ref:`func_acl.get`
* :ref:`func_acl.protect`
* :ref:`func_acl.protected`
* :ref:`func_acl.set`
* :ref:`func_acl.undefine`
* :ref:`obj_backend`
* :ref:`func_backend.defined`
* :ref:`func_backend.get`
* :ref:`func_backend.protect`
* :ref:`func_backend.protected`
* :ref:`func_backend.set`
* :ref:`func_backend.undefine`
* :ref:`obj_blob`
* :ref:`func_blob.defined`
* :ref:`func_blob.get`
* :ref:`func_blob.protect`
* :ref:`func_blob.protected`
* :ref:`func_blob.set`
* :ref:`func_blob.undefine`
* :ref:`obj_body`
* :ref:`func_body.defined`
* :ref:`func_body.get`
* :ref:`func_body.protect`
* :ref:`func_body.protected`
* :ref:`func_body.set`
* :ref:`func_body.undefine`
* :ref:`obj_bool`
* :ref:`func_bool.defined`
* :ref:`func_bool.get`
* :ref:`func_bool.protect`
* :ref:`func_bool.protected`
* :ref:`func_bool.set`
* :ref:`func_bool.undefine`
* :ref:`obj_bytes`
* :ref:`func_bytes.defined`
* :ref:`func_bytes.get`
* :ref:`func_bytes.protect`
* :ref:`func_bytes.protected`
* :ref:`func_bytes.set`
* :ref:`func_bytes.undefine`
* :ref:`obj_duration`
* :ref:`func_duration.defined`
* :ref:`func_duration.get`
* :ref:`func_duration.protect`
* :ref:`func_duration.protected`
* :ref:`func_duration.set`
* :ref:`func_duration.undefine`
* :ref:`obj_header`
* :ref:`func_header.defined`
* :ref:`func_header.get`
* :ref:`func_header.protect`
* :ref:`func_header.protected`
* :ref:`func_header.set`
* :ref:`func_header.undefine`
* :ref:`obj_int`
* :ref:`func_int.defined`
* :ref:`func_int.get`
* :ref:`func_int.protect`
* :ref:`func_int.protected`
* :ref:`func_int.set`
* :ref:`func_int.undefine`
* :ref:`obj_ip`
* :ref:`func_ip.defined`
* :ref:`func_ip.get`
* :ref:`func_ip.protect`
* :ref:`func_ip.protected`
* :ref:`func_ip.set`
* :ref:`func_ip.undefine`
* :ref:`obj_probe`
* :ref:`func_probe.defined`
* :ref:`func_probe.get`
* :ref:`func_probe.protect`
* :ref:`func_probe.protected`
* :ref:`func_probe.set`
* :ref:`func_probe.undefine`
* :ref:`obj_real`
* :ref:`func_real.defined`
* :ref:`func_real.get`
* :ref:`func_real.protect`
* :ref:`func_real.protected`
* :ref:`func_real.set`
* :ref:`func_real.undefine`
* :ref:`obj_stevedore`
* :ref:`func_stevedore.defined`
* :ref:`func_stevedore.get`
* :ref:`func_stevedore.protect`
* :ref:`func_stevedore.protected`
* :ref:`func_stevedore.set`
* :ref:`func_stevedore.undefine`
* :ref:`obj_string`
* :ref:`func_string.defined`
* :ref:`func_string.get`
* :ref:`func_string.protect`
* :ref:`func_string.protected`
* :ref:`func_string.set`
* :ref:`func_string.undefine`
* :ref:`obj_time`
* :ref:`func_time.defined`
* :ref:`func_time.get`
* :ref:`func_time.protect`
* :ref:`func_time.protected`
* :ref:`func_time.set`
* :ref:`func_time.undefine`
.. _obj_acl:
new xacl = topvar.acl([ACL init])
---------------------------------
Construct a(n) ACL topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_acl.get:
ACL xacl.get(ACL fallback)
--------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_acl.set:
VOID xacl.set(ACL)
------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_acl.undefine:
VOID xacl.undefine()
--------------------
Undefine the topvar.
.. _func_acl.defined:
BOOL xacl.defined()
-------------------
Return whether the topvar is defined.
.. _func_acl.protect:
VOID xacl.protect()
-------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_acl.protected:
BOOL xacl.protected()
---------------------
Return whether the topvar is protected.
.. _obj_backend:
new xbackend = topvar.backend([BACKEND init])
---------------------------------------------
Construct a(n) BACKEND topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_backend.get:
BACKEND xbackend.get(BACKEND fallback=0)
----------------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is no backend.
.. _func_backend.set:
VOID xbackend.set(BACKEND)
--------------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_backend.undefine:
VOID xbackend.undefine()
------------------------
Undefine the topvar.
.. _func_backend.defined:
BOOL xbackend.defined()
-----------------------
Return whether the topvar is defined.
.. _func_backend.protect:
VOID xbackend.protect()
-----------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_backend.protected:
BOOL xbackend.protected()
-------------------------
Return whether the topvar is protected.
.. _obj_blob:
new xblob = topvar.blob([BLOB init])
------------------------------------
Construct a(n) BLOB topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_blob.get:
BLOB xblob.get(BLOB fallback)
-----------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_blob.set:
VOID xblob.set(BLOB)
--------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_blob.undefine:
VOID xblob.undefine()
---------------------
Undefine the topvar.
.. _func_blob.defined:
BOOL xblob.defined()
--------------------
Return whether the topvar is defined.
.. _func_blob.protect:
VOID xblob.protect()
--------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_blob.protected:
BOOL xblob.protected()
----------------------
Return whether the topvar is protected.
.. _obj_body:
new xbody = topvar.body([BODY init])
------------------------------------
Construct a(n) BODY topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_body.get:
BODY xbody.get(BODY fallback)
-----------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_body.set:
VOID xbody.set(BODY)
--------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_body.undefine:
VOID xbody.undefine()
---------------------
Undefine the topvar.
.. _func_body.defined:
BOOL xbody.defined()
--------------------
Return whether the topvar is defined.
.. _func_body.protect:
VOID xbody.protect()
--------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_body.protected:
BOOL xbody.protected()
----------------------
Return whether the topvar is protected.
.. _obj_bool:
new xbool = topvar.bool([BOOL init])
------------------------------------
Construct a(n) BOOL topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bool.get:
BOOL xbool.get(BOOL fallback)
-----------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_bool.set:
VOID xbool.set(BOOL)
--------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_bool.undefine:
VOID xbool.undefine()
---------------------
Undefine the topvar.
.. _func_bool.defined:
BOOL xbool.defined()
--------------------
Return whether the topvar is defined.
.. _func_bool.protect:
VOID xbool.protect()
--------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_bool.protected:
BOOL xbool.protected()
----------------------
Return whether the topvar is protected.
.. _obj_bytes:
new xbytes = topvar.bytes([BYTES init])
---------------------------------------
Construct a(n) BYTES topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_bytes.get:
BYTES xbytes.get(BYTES fallback)
--------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_bytes.set:
VOID xbytes.set(BYTES)
----------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_bytes.undefine:
VOID xbytes.undefine()
----------------------
Undefine the topvar.
.. _func_bytes.defined:
BOOL xbytes.defined()
---------------------
Return whether the topvar is defined.
.. _func_bytes.protect:
VOID xbytes.protect()
---------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_bytes.protected:
BOOL xbytes.protected()
-----------------------
Return whether the topvar is protected.
.. _obj_duration:
new xduration = topvar.duration([DURATION init])
------------------------------------------------
Construct a(n) DURATION topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_duration.get:
DURATION xduration.get(DURATION fallback=0)
-------------------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is 0s.
.. _func_duration.set:
VOID xduration.set(DURATION)
----------------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_duration.undefine:
VOID xduration.undefine()
-------------------------
Undefine the topvar.
.. _func_duration.defined:
BOOL xduration.defined()
------------------------
Return whether the topvar is defined.
.. _func_duration.protect:
VOID xduration.protect()
------------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_duration.protected:
BOOL xduration.protected()
--------------------------
Return whether the topvar is protected.
.. _obj_header:
new xheader = topvar.header([HEADER init])
------------------------------------------
Construct a(n) HEADER topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_header.get:
HEADER xheader.get(HEADER fallback)
-----------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_header.set:
VOID xheader.set(HEADER)
------------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_header.undefine:
VOID xheader.undefine()
-----------------------
Undefine the topvar.
.. _func_header.defined:
BOOL xheader.defined()
----------------------
Return whether the topvar is defined.
.. _func_header.protect:
VOID xheader.protect()
----------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_header.protected:
BOOL xheader.protected()
------------------------
Return whether the topvar is protected.
.. _obj_int:
new xint = topvar.int([INT init])
---------------------------------
Construct a(n) INT topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_int.get:
INT xint.get(INT fallback=0)
----------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is 0.
.. _func_int.set:
VOID xint.set(INT)
------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_int.undefine:
VOID xint.undefine()
--------------------
Undefine the topvar.
.. _func_int.defined:
BOOL xint.defined()
-------------------
Return whether the topvar is defined.
.. _func_int.protect:
VOID xint.protect()
-------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_int.protected:
BOOL xint.protected()
---------------------
Return whether the topvar is protected.
.. _obj_ip:
new xip = topvar.ip([IP init])
------------------------------
Construct a(n) IP topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_ip.get:
IP xip.get(IP fallback)
-----------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_ip.set:
VOID xip.set(IP)
----------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_ip.undefine:
VOID xip.undefine()
-------------------
Undefine the topvar.
.. _func_ip.defined:
BOOL xip.defined()
------------------
Return whether the topvar is defined.
.. _func_ip.protect:
VOID xip.protect()
------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_ip.protected:
BOOL xip.protected()
--------------------
Return whether the topvar is protected.
.. _obj_probe:
new xprobe = topvar.probe([PROBE init])
---------------------------------------
Construct a(n) PROBE topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_probe.get:
PROBE xprobe.get(PROBE fallback)
--------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_probe.set:
VOID xprobe.set(PROBE)
----------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_probe.undefine:
VOID xprobe.undefine()
----------------------
Undefine the topvar.
.. _func_probe.defined:
BOOL xprobe.defined()
---------------------
Return whether the topvar is defined.
.. _func_probe.protect:
VOID xprobe.protect()
---------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_probe.protected:
BOOL xprobe.protected()
-----------------------
Return whether the topvar is protected.
.. _obj_real:
new xreal = topvar.real([REAL init])
------------------------------------
Construct a(n) REAL topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_real.get:
REAL xreal.get(REAL fallback=0.0)
---------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is 0.0.
.. _func_real.set:
VOID xreal.set(REAL)
--------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_real.undefine:
VOID xreal.undefine()
---------------------
Undefine the topvar.
.. _func_real.defined:
BOOL xreal.defined()
--------------------
Return whether the topvar is defined.
.. _func_real.protect:
VOID xreal.protect()
--------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_real.protected:
BOOL xreal.protected()
----------------------
Return whether the topvar is protected.
.. _obj_stevedore:
new xstevedore = topvar.stevedore([STEVEDORE init])
---------------------------------------------------
Construct a(n) STEVEDORE topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_stevedore.get:
STEVEDORE xstevedore.get(STEVEDORE fallback)
--------------------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined.
.. _func_stevedore.set:
VOID xstevedore.set(STEVEDORE)
------------------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_stevedore.undefine:
VOID xstevedore.undefine()
--------------------------
Undefine the topvar.
.. _func_stevedore.defined:
BOOL xstevedore.defined()
-------------------------
Return whether the topvar is defined.
.. _func_stevedore.protect:
VOID xstevedore.protect()
-------------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_stevedore.protected:
BOOL xstevedore.protected()
---------------------------
Return whether the topvar is protected.
.. _obj_string:
new xstring = topvar.string([STRING init])
------------------------------------------
Construct a(n) STRING topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_string.get:
STRING xstring.get(STRING fallback=0)
-------------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is the empty string.
.. _func_string.set:
VOID xstring.set(STRING)
------------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_string.undefine:
VOID xstring.undefine()
-----------------------
Undefine the topvar.
.. _func_string.defined:
BOOL xstring.defined()
----------------------
Return whether the topvar is defined.
.. _func_string.protect:
VOID xstring.protect()
----------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_string.protected:
BOOL xstring.protected()
------------------------
Return whether the topvar is protected.
.. _obj_time:
new xtime = topvar.time([TIME init])
------------------------------------
Construct a(n) TIME topvar with the default value `init`,
if provided. If no `init` value is provided, the variable
will be initially undefined.
.. _func_time.get:
TIME xtime.get(TIME fallback=0)
-------------------------------
Return the value of the topvar or the `fallback` argument
if it is undefined. The default fallback is the epoch (1970/1/1 0:00:00 GMT).
.. _func_time.set:
VOID xtime.set(TIME)
--------------------
Set the value of the topvar.
Triggers a vcl failure for protected variables.
.. _func_time.undefine:
VOID xtime.undefine()
---------------------
Undefine the topvar.
.. _func_time.defined:
BOOL xtime.defined()
--------------------
Return whether the topvar is defined.
.. _func_time.protect:
VOID xtime.protect()
--------------------
Protect the topvar, so any future .set() calls on it
trigger a vcl failure.
.. _func_time.protected:
BOOL xtime.protected()
----------------------
Return whether the topvar is protected.
SEE ALSO
========
vcl\(7),varnishd\(1)
COPYRIGHT
=========
::
Copyright 2018 UPLEX Nils Goroll Systemoptimierung
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment