DopplerConfigProvider (doppler_config_provider v0.2.4) View Source

DopplerConfigProvider fetches the config from Doppler and merges it with your application config at system boot.

Link to this section Summary

Functions

Perform the request to Doppler with the provided HTTP module.

Invoked when initializing the config provider.

Perform the JSON decoding with the provided JSON module.

Loads configuration and is typically invoked very early in the boot process.

Link to this section Types

Specs

http_module() :: module() | {atom(), module()}

Specs

json_module() :: module() | {atom(), module()}

Specs

map_options() :: %{
  service_token: service_token(),
  http_module: http_module(),
  json_module: json_module(),
  mappings: mappings()
}

Specs

mappings() :: %{required(String.t()) => [key :: term()]}

Specs

options() :: [
  service_token: service_token(),
  http_module: http_module(),
  json_module: json_module(),
  mappings: mappings()
]

Specs

service_token() :: String.t()

Link to this section Functions

Link to this function

fetch_doppler_config!(opts, url \\ "https://api.doppler.com/v3/configs/config/secrets/download")

View Source

Specs

fetch_doppler_config!(map_options(), String.t()) :: map() | no_return()

Perform the request to Doppler with the provided HTTP module.

Specs

init(options()) :: options()

Invoked when initializing the config provider.

Since we can pass the config through application env (config files), we can't really do any validation on the options here. So, it's just a pass-through.

Link to this function

json_decode!(body, opts)

View Source

Specs

json_decode!(String.t(), map_options()) :: map() | no_return()

Perform the JSON decoding with the provided JSON module.

Loads configuration and is typically invoked very early in the boot process.