Resolves endpoint, emulator, and Finch settings for GcpGcs.
Production (default)
No configuration is required. Requests go to https://storage.googleapis.com
and authenticate via GcpGcs.Auth.
Emulator (development / test)
Point the client at a local emulator such as fake-gcs-server:
config :gcp_gcs, :emulator,
scheme: "http",
host: "localhost",
port: 4443Alternatively, set the STORAGE_EMULATOR_HOST environment variable
(honored by the official Google client libraries), e.g.
STORAGE_EMULATOR_HOST=http://localhost:4443.
When an emulator is configured, authentication is skipped.
Finch pool
config :gcp_gcs, :finch,
pool_size: 50,
pool_count: 1Timeouts
config :gcp_gcs, :default_timeout, 30_000
Summary
Functions
Base URL for the JSON API, e.g. https://storage.googleapis.com.
Default request timeout in milliseconds.
Whether an emulator is configured (auth is skipped when true).
The scheme/host/port the Finch pool should connect to.
The registered name of the Finch pool started by GcpGcs.Application.
Base URL for JSON metadata operations, e.g. .../storage/v1.
Base URL for media/resumable uploads, e.g. .../upload/storage/v1.
Types
@type emulator() :: %{scheme: String.t(), host: String.t(), port: pos_integer()}
Functions
@spec base_url() :: String.t()
Base URL for the JSON API, e.g. https://storage.googleapis.com.
@spec default_timeout() :: pos_integer()
Default request timeout in milliseconds.
@spec emulator?() :: boolean()
Whether an emulator is configured (auth is skipped when true).
@spec endpoint() :: {:http | :https, String.t(), pos_integer()}
The scheme/host/port the Finch pool should connect to.
Returns {scheme, host, port} where scheme is :http or :https.
@spec finch_name() :: atom()
The registered name of the Finch pool started by GcpGcs.Application.
@spec json_base() :: String.t()
Base URL for JSON metadata operations, e.g. .../storage/v1.
@spec upload_base() :: String.t()
Base URL for media/resumable uploads, e.g. .../upload/storage/v1.