confex v3.5.0 Confex.Adapters.FileFromSystemEnvironment

Adapter to fetch values from a file with path specified in a system environment variables.

Link to this section Summary

Functions

Fetch value from file which path is specified in an environment variable

Link to this section Functions

Link to this function

fetch_value(key)

Fetch value from file which path is specified in an environment variable.

Newline in the end of file is ignored.

Example

iex> :ok = System.delete_env("SOME_TEST_FILE")
...> :error = Elixir.Confex.Adapters.FileFromSystemEnvironment.fetch_value("SOME_TEST_FILE")
...> :ok = System.put_env("SOME_TEST_FILE", "test/fixtures/file_secret.txt")
...> {:ok, "foo_bar"} = Elixir.Confex.Adapters.FileFromSystemEnvironment.fetch_value("SOME_TEST_FILE")
{:ok, "foo_bar"}