Cloud Storage v0.5.1 CloudStorage.Google View Source
CloudStorage Google Documentation.
Link to this section Summary
Functions
Delete a File
Download a File
Get Files
Get a Rest Token
A callback executed when the Goth.Config server starts
Purge a CDN path content
Send a File
Upload a File
Upload a File from an URL
Link to this section Functions
delete(full_path, bucket \\ "phishx-cdn") View Source
Delete a File.
Examples
iex> CloudStorage.Google.delete("accounts/temp_file.txt")
iex> CloudStorage.Google.put("accounts/temp_file.txt")
download(remote_path, local_path, bucket \\ "phishx-cdn") View Source
Download a File.
Examples
iex> CloudStorage.Google.download("accounts/temp_file.txt", "test")
get(full_path, bucket \\ "phishx-cdn") View Source
Get Files.
Examples
iex> CloudStorage.Google.get("accounts/logo.png") |> elem(0) :ok
get_token() View Source
Get a Rest Token.
Examples
iex> CloudStorage.Google.get_token() |> is_nil() false
init(config) View Source
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
Callback implementation for Goth.Config.init/1
.
list(full_path \\ "", folders \\ false, bucket \\ "phishx-cdn") View Source
List Files.
Examples
iex> CloudStorage.Google.list("accounts/logo.png") |> elem(1) |> List.first() |> Map.get("name") "accounts/logo.png"
purge(full_path, bucket \\ "phishx-cdn") View Source
Purge a CDN path content.
Examples
iex> CloudStorage.Google.purge("/accounts/temp_file.txt")
put(full_path, content \\ "", type \\ "application/octet-stream", bucket \\ "phishx-cdn") View Source
Send a File.
Examples
iex> CloudStorage.Google.put("accounts/temp_file.txt")
upload(local_path, remote_path, bucket \\ "phishx-cdn") View Source
Upload a File.
Examples
iex> CloudStorage.Google.upload("test/temp_file.txt", "accounts/temp_file.txt")
url(url, remote_path, bucket \\ "phishx-cdn") View Source
Upload a File from an URL.
Examples
iex> CloudStorage.Google.url("https://www.google.com.br/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png", "accounts/logo.png")