Lamina.Server.Table (lamina v0.2.2)

A wrapper around ETS for our specific use cases.

Link to this section Summary

Functions

Delete any expired rows from the ETS table.

Find the most likely configuration value for a given configuration key.

Get a specific configuration value from the ETS table.

Insert any number of configuration values into the ETS table.

Initialises a new ETS table.

Remove matching configuration values from the ETS table.

Link to this section Types

Specs

lifetime() :: Lamina.Provider.lifetime()

Specs

provider() :: module()

Specs

t() :: :ets.tid()

Specs

value() :: any()

Link to this section Functions

Specs

expire(t()) :: :ok

Delete any expired rows from the ETS table.

Link to this function

get(table, config_key)

Specs

Find the most likely configuration value for a given configuration key.

This executes a gently complicated match spec against the ETS table to find a configuration value which has the highest provider priority and is not expired.

Link to this function

get(table, config_key, provider)

Specs

Get a specific configuration value from the ETS table.

Searches by config_key and provider only - does not take into account the row's expiry time.

Link to this function

insert(table, config_values)

Specs

insert(t(), [Lamina.Server.ConfigValue.t()]) :: :ok

Insert any number of configuration values into the ETS table.

Specs

new(module()) :: t()

Initialises a new ETS table.

Link to this function

remove(table, provider, config_key)

Specs

remove(t(), provider(), config_key) :: :ok when config_key: atom()

Remove matching configuration values from the ETS table.