ExStorageServiceSdk.Config (ex_storage_service_sdk v0.7.1)

Copy Markdown View Source

Immutable connection settings captured by one client.

Every request made with a config uses its own endpoint, region, credentials and transport, independent of global application settings. Build one with ExStorageServiceSdk.new/1.

Extension points:

  • :credential_provider - zero-arity function returning {:ok, %ExStorageServiceSdk.Credentials{}} or {:error, %ExStorageServiceSdk.Error{}}. It is called before each signed request, so it can rotate temporary credentials.
  • :session_provider - S3 Express directory-bucket session resolver, fn config, bucket, endpoint, mode -> {:ok, credentials} | {:error, error} end.
  • :transport - module implementing ExStorageServiceSdk.Transport.
  • :coordinator - optional ExStorageServiceSdk.Transfer.Coordinator bounding request memory and propagating cancellation.
  • :options - map of protocol options (for example :request_headers, :request_checksum_calculation, :debug). Unknown keys are ignored by the SDK.

Summary

Functions

Refreshes the credential record before request signing.

Replaces the active credential record and its derived signing fields.

Types

t()

@type t() :: %ExStorageServiceSdk.Config{
  access_key_id: term(),
  addressing: term(),
  capabilities: term(),
  connect_timeout: term(),
  coordinator: term(),
  credential_provider: term(),
  credentials: term(),
  endpoint: term(),
  frontend: term(),
  options: term(),
  read_idle_timeout: term(),
  region: term(),
  secret_access_key: term(),
  session_provider: term(),
  session_token: term(),
  timeout: term(),
  tls: term(),
  transport: term(),
  unsigned: term(),
  write_idle_timeout: term()
}

Functions

refresh(config)

Refreshes the credential record before request signing.

with_credentials(config, credentials)

Replaces the active credential record and its derived signing fields.