Cloud Storage v0.5.1 CloudStorage.Google View Source

CloudStorage Google Documentation.

Link to this section Summary

Link to this section Functions

Link to this function

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")

Link to this function

download(remote_path, local_path, bucket \\ "phishx-cdn") View Source

Download a File.

Examples

iex> CloudStorage.Google.download("accounts/temp_file.txt", "test")

Link to this function

get(full_path, bucket \\ "phishx-cdn") View Source

Get Files.

Examples

iex> CloudStorage.Google.get("accounts/logo.png") |> elem(0) :ok

Get a Rest Token.

Examples

iex> CloudStorage.Google.get_token() |> is_nil() false

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.

Link to this function

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"

Link to this function

purge(full_path, bucket \\ "phishx-cdn") View Source

Purge a CDN path content.

Examples

iex> CloudStorage.Google.purge("/accounts/temp_file.txt")

Link to this function

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")

Link to this function

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")

Link to this function

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")