Author: | Tollef Fog Heen |
---|---|
Date: | 2011-09-28 |
Version: | 1.0 |
Manual section: | 3 |
import var;
Association list in VCL. Can be used to mimick variables.
- Prototype
- set_string(STRING S, STRING T) set(STRING S, STRING T) - shorthand
- Return value
- NONE
- Description
- Sets the variable identified by S to the value T.
- Example
- var.set_string("bar", "some random string");
- Prototype
- get_string(STRING S) get(STRING S) - shorthand
- Return value
- STRING
- Description
- Returns the string identified by the supplied string.
- Example
- set resp.http.foo = var.get_string("bar");
There are similar functions named:
- set_int(STRING, INT)
- get_int(STRING)
- set_real(STRING, REAL)
- get_real(STRING)
- set_duration(STRING, DURATION)
- get_duration(STRING)
get and set are shorthand for get_string and set_string.
- Prototype
- Function VOID clear()
- Returns
- NONE
- Description
- Clears out all the variables.
Example
This manual page was written by Per Buer. It might contain errors. Patches are welcome.
This document is licensed under the same license as the libvmod-example project. See LICENSE for details.
- Copyright (c) 2012 Varnish Software