View Source Rivet.Utils.JsonConfigProvider (rivet_utils v1.1.7)

Derived from toml-elixir/Toml.Provider https://github.com/bitwalker/toml-elixir/blob/master/lib/provider.ex and https://hexdocs.pm/elixir/Config.Provider.html#module-sample-config-provider

This is a runtime config provider (for 12factor apps).

It will merge json data into the config structure.

In Elixir Config: config :app, That.Module, the: thing

In Elixir (Raw)

Application.get_env(:app, That.Module) [{ the: "thing" }]

In JSON, you have two special syntaxes to the keys:

  1. prefix 'Elixir.' on the module name if it's an elixir module:

{"app": {"Elixir.That.Module": {"the": "thing"}}}

  1. use "$NAME:name" as the key and it will pull that value at runtime from the OS environment[NAME], saving it as [name] in the current heirarchial location of the config file, defaulting the value to whatever is set in the static variable instead.

Contributor: Brandon Gillespie

Link to this section Summary

Link to this section Functions

Callback implementation for Config.Provider.init/1.

Link to this function

keyword_pair(k, v_default)

View Source
Link to this function

load(config, default_path)

View Source

Callback implementation for Config.Provider.load/2.