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

Link to this function

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

do_start(error)

Helper function to start or restart the GenServer when already started with given settings

Link to this function

get()
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 a specific cloudinary credential by key.

Examples

iex> Cloudex.Settings.get(:secret)
"my_secret"

iex> Cloudex.Settings.get(:bogus)
nil

Required by GenServer

Link to this function

start(settings)

Actually starting the GenServer with given settings

Link to this function

start(atom, list)

Called by the supervisor, this will use settings defined in config.exs or ENV vars

Helper function to stop the GenServer