GcsSignedUrl.Client (gcs_signed_url v0.6.0)

Copy Markdown View Source

Defines Google Cloud Storage Signed Url Client

Summary

Functions

Creates a PEM binary from the given client's private_key and decodes it.

Initialize GcsSignedUrl.Client with given map, or load a file if called with a path string.

Initialize GcsSignedUrl.Client using a config file.

Types

t()

@type t() :: %GcsSignedUrl.Client{client_email: String.t(), private_key: String.t()}

Functions

get_decoded_private_key(client)

@spec get_decoded_private_key(t()) :: tuple()

Creates a PEM binary from the given client's private_key and decodes it.

load(path)

@spec load(map() | String.t()) :: t()

Initialize GcsSignedUrl.Client with given map, or load a file if called with a path string.

Examples

iex> service_account = service_account_json_string |> JSON.decode!
iex> GcsSignedUrl.Client.load(service_account)
%GcsSignedUrl.Client{...}

iex> GcsSignedUrl.Client.load("/home/alexandrubagu/config/google.json")
%GcsSignedUrl.Client{...}

load_from_file(path)

@spec load_from_file(String.t()) :: t()

Initialize GcsSignedUrl.Client using a config file.

Examples

iex>
iex> GcsSignedUrl.Client.load_from_file("/home/alexandrubagu/config/google.json")
%GcsSignedUrl.Client{...}