Waffle.Storage.Google.Util (Glific forked Waffle GCS v0.1.1) 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.
The function Objects.storage_objects_insert/4
has the wrong URL and will
always fail to perform an upload. Because these clients are automatically
generated, there needs to be an investigation as to why this URL is being
incorrectly set before a solution can be applied. This version of the function
is an exact copy/paste of the official function except that it uses the
correct upload URL.
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"
storage_objects_insert(connection, bucket, optional_params \\ [], opts \\ [])
View SourceSpecs
storage_objects_insert( Tesla.Env.client(), String.t(), Keyword.t(), Keyword.t() ) :: Waffle.Storage.Google.CloudStorage.object_or_error()
The function Objects.storage_objects_insert/4
has the wrong URL and will
always fail to perform an upload. Because these clients are automatically
generated, there needs to be an investigation as to why this URL is being
incorrectly set before a solution can be applied. This version of the function
is an exact copy/paste of the official function except that it uses the
correct upload URL.
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}
).