cloudex v1.2.2 Cloudex.Settings
This is a GenServer that contains the API settings for cloudinary
You can interact with the get
function to retreive the settings you want.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor
Helper function to start or restart the GenServer when already started with given settings
Get the cloudinary credentials as map
Get a specific cloudinary credential by key
Required by GenServer
Actually starting the GenServer with given settings
Called by the supervisor, this will use settings defined in config.exs or ENV vars
Helper function to stop the GenServer
Link to this section Functions
child_spec(arg)
Returns a specification to start this module under a supervisor.
See Supervisor
.
do_start(error)
Helper function to start or restart the GenServer when already started with given settings
get()
get() :: map()
get() :: map()
Get the cloudinary credentials as map.
Examples
iex> Cloudex.Settings.get
%{api_key: "my_key", secret: "my_secret", cloud_name: "my_cloud_name"}
get(key)
Get a specific cloudinary credential by key.
Examples
iex> Cloudex.Settings.get(:secret)
"my_secret"
iex> Cloudex.Settings.get(:bogus)
nil
init(args)
Required by GenServer
start(settings)
Actually starting the GenServer with given settings
start(atom, list)
Called by the supervisor, this will use settings defined in config.exs or ENV vars
stop()
Helper function to stop the GenServer