lua_maps
This module contains helper functions for managing rspamd maps
Functions:
Function | Description |
---|---|
lua_maps.map_add_from_ucl(opt, mtype, description) |
Creates a map from static data. |
lua_maps.map_add(mname, optname, mtype, description) |
Creates a map from configuration elements (static data or URL). |
lua_maps.fill_config_maps(mname, options, defs) |
Fill maps that could be defined in defs, from the config in the options. |
The module lua_maps
defines the following functions.
lua_maps.map_add_from_ucl(opt, mtype, description)
Creates a map from static data Returns true if map was added or nil
Parameters:
opt {string or table}
: data for map (or URL)mtype {string}
: type of map (set
, map
, radix
, regexp
)description {string}
: human-readable description of mapcallback {function}
: optional callback that will be called on map match (required for external maps)Returns:
{bool}
: true on success, or nil
Back to module description.
lua_maps.map_add(mname, optname, mtype, description)
Creates a map from configuration elements (static data or URL) Returns true if map was added or nil
Parameters:
mname {string}
: config section to useoptname {string}
: option name to usemtype {string}
: type of map (‘set’, ‘hash’, ‘radix’, ‘regexp’, ‘glob’)description {string}
: human-readable description of mapcallback {function}
: optional callback that will be called on map match (required for external maps)Returns:
{bool}
: true on success, or nil
Back to module description.
lua_maps.fill_config_maps(mname, options, defs)
Fill maps that could be defined in defs, from the config in the options Defs is a table indexed by a map’s parameter name and defining it’s config,
Parameters:
No parameters
Returns:
No return
Back to module description.
Back to top.