Module rspamd_map

This module is used to manage rspamd maps and map like objects

All maps could be obtained by function rspamd_config:get_maps() Also see lua_maps module description.

Brief content:

Methods:

Methods

The module rspamd_map defines the following methods.

Method map:get_key(in)

Variable method for different types of maps:

  • For hash maps it returns boolean and accepts string
  • For kv maps it returns string (or nil) and accepts string
  • For radix maps it returns boolean and accepts IP address (as object, string or number)

Parameters:

  • in {vary}: input to check

Returns:

  • {bool|string}: if a value is found then this function returns string or True if not - then it returns nil or False

Back to module description.

Method map:is_signed()

Returns True if a map is signed

Parameters:

No parameters

Returns:

  • {bool}: signed value

Back to module description.

Method map:get_proto()

Returns protocol of map as string:

  • http: for HTTP map
  • file: for file map

Parameters:

No parameters

Returns:

  • {string}: string representation of the map protocol

Back to module description.

Method map:get_sign_key()

Returns pubkey used for signing as base32 string or nil

Parameters:

No parameters

Returns:

  • {string}: base32 encoded string or nil

Back to module description.

Method map:set_sign_key(key)

Set trusted key for signatures for this map

Parameters:

  • key {string}: base32 encoded string or nil

Returns:

No return

Back to module description.

Method map:set_callback(cb)

Set callback for a specified callback map.

Parameters:

  • cb {function}: map callback function

Returns:

No return

Back to module description.

Method map:get_uri()

Get uri for a specified map

Parameters:

No parameters

Returns:

  • {string}: map’s URI

Back to module description.

Method map:get_stats(reset)

Get statistics for specific map. It returns table in form: [key] => [nhits]

Parameters:

  • reset {boolean}: reset stats if true

Returns:

  • {table}: map’s stat

Back to module description.

Method map:get_data_digest()

Get data digest for specific map

Parameters:

No parameters

Returns:

  • {string}: 64 bit number represented as string (due to Lua limitations)

Back to module description.

Method map:get_nelts()

Get number of elements for specific map

Parameters:

No parameters

Returns:

  • {number}: number of elements in the map

Back to module description.

Back to top.