summaryrefslogtreecommitdiffabout
path: root/src/vmod_dict.vcc
blob: c5599a0e062f0f9b8f5bdd223dbfe85957bd01cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
$Module dict 3 "Dictionary look-up for Varnish Cache"

DESCRIPTION
===========

Provides simple key/value dictionary API. The dictionary is kept in
a disk file. Each non-empty line in such a file is either a comment
or a pair of keyword - value separated by one or more whitespace characters.
Leading and trailing whitespace is discarded. Comments are introduced by a
hash sign at the beginning of the line. Empty lines and comments are ignored.

$Event dict_event
$Function VOID ci(BOOL v)

Description
    If **v** is **true**, sets case-insensitive string comparison. Default is
    case-sensitive comparison.

$Function VOID collisions(INT n)

Description
    Sets the maximum allowable length of collision chain in the hash table.
    Negative value of **n** means unlimited length. Otherwise, the module will
    adjust the hash table load factor to ensure the number of collisions
    doesn't exceed **n**.
    
$Function VOID load(STRING file)

Description
    Loads key/value dictionary from **file** into memory. The **file** must
    exist and be readable for the user varnish runs as.

    This function is normally called from **vcl_init**.

$Function VOID clear()

Description
    Clears entire dictionary.
    
$Function STRING lookup(STRING key)

Description
    Looks up the **key** in the table loaded by the **dict.load**.
    Returns the value if found, or **NULL** otherwise.

COPYRIGHT
=========

| Copyright (C) Sergey Poznyakoff
| License GPLv3+: GNU GPL version 3 or later
| <http://gnu.org/licenses/gpl.html>
| This  is  free  software:  you  are free to change and redistribute it.
| There is NO WARRANTY, to the extent permitted by law.

Return to:

Send suggestions and report system problems to the System administrator.