Ptolemy v0.2.0 Ptolemy.Providers.SystemEnv View Source

Ptolemy.Providers.SystemEnv provides from system environment variables.

Example

Add to your configuration:

alias Ptolemy.Providers.SystemEnv
config :ptolemy, loader: [
  env: [
    {{:app_name, :config_key}, {SystemEnv, "VAR_NAME"}}
  ]
]

The :app_name and :config_key are added to reference the application environment key that will be set. The value can be accessed at any time with Application.get_env/2. "VAR_NAME" is the name of the system environment variable that will be loaded on application startup. Loaded values are all static and will never be updated during runtime.

Required Environment Variables

None

Link to this section Summary

Functions

Invoked to setup a provider. This callback is only called once per provider, and is called lazily

Invoked when querying the provider for a value

Link to this section Functions

Invoked to setup a provider. This callback is only called once per provider, and is called lazily.

Callback implementation for Ptolemy.Provider.init/1.

Link to this function

load(loader_pid, var_name) View Source

Invoked when querying the provider for a value.

Callback implementation for Ptolemy.Provider.load/2.