Waffle.Storage.Google.Util (Waffle GCS v0.2.0) View Source
A collection of utility functions.
Link to this section Summary
Functions
Attempts to return a value from a given options list, using the application
configs as a back-up. The application (used in Application.get_env/3
) is
assumed to be :waffle
.
If the given string does not already start with a forward slash, this function will prepend one and return the result.
Accepts four forms of variables
Link to this section Functions
Specs
Attempts to return a value from a given options list, using the application
configs as a back-up. The application (used in Application.get_env/3
) is
assumed to be :waffle
.
This assumes that the application environment is set using waffle
as the
application name.
If the value is not found in any of those location, an optional default value can be returned.
Specs
If the given string does not already start with a forward slash, this function will prepend one and return the result.
Examples
> prepend_slash("some/path")
"/some/path"
> prepend_slash("/im/good")
"/im/good"
Specs
Accepts four forms of variables:
- The tuple
{:system, key}
, which usesSystem.get_env/1
. - The tuple
{:app, key}
, which usesApplication.get_env/2
. - The tuple
{:app, app, key}
, which useesApplication.get_env/2
. - Anything else which is returned as-is.
In the second form ({:app, key}
), the application is assumed to be :waffle
although this can be overriden using the third form ({:app, app, key}
).