ConfigZ v0.3.0 ConfigZ View Source

Runtime configuration for Elixir applications.

Link to this section Summary

Functions

Initialize the watcher

Read the config value

Watch the config, the callback function will be called whenever it is changed

Link to this section Types

Link to this type

callback() View Source
callback() :: (String.t() -> any())

Link to this section Functions

Link to this function

init(args) View Source
init(keyword()) :: :ok | {:error, String.t()}

Initialize the watcher.

Arguments

  • :name: Unique name of the watcher.
  • :adapter: Only supports :config_map.
  • :callbacks: The map of config keys and callbacks.
  • For :config_map adapter:

    • :dir: The path of the directory that mounted config map volume.
Link to this function

read(name, config_name) View Source
read(atom(), String.t()) :: any()

Read the config value.

Link to this function

watch(name, config_name, callback) View Source
watch(atom(), String.t(), callback()) :: :ok

Watch the config, the callback function will be called whenever it is changed.