goth v0.8.2 Goth.Config behaviour
Goth.Config
is a GenServer
that holds the current configuration.
This configuration is loaded from one of four places:
- a JSON string passed in via your application’s config
- a ENV variable passed in via your application’s config
- The Application Default Credentials, as defined by https://developers.google.com/identity/protocols/application-default-credentials
- an
init/1
callback on a custom config module. This init function is passed the current config and must return an{:ok, config}
tuple
The Goth.Config
server exists mostly for other parts of your application
(or other libraries) to pull the current configuration state,
via Goth.Config.get/1
. If necessary, you can also set config values via
Goth.Config.set/2
Summary
Callbacks
A callback executed when the Goth.Config server starts
Functions
Callbacks
A callback executed when the Goth.Config server starts.
The sole argument is the :goth
configuration as stored in the
application environment. It must return {:ok, keyword}
with the updated
list of configuration.
To have your module’s init/1
callback called at startup, add your module
as the :config_module
in the application environment:
config :goth, config_module: MyConfig