Buckets.Adapter behaviour (buckets v1.0.0-rc.1)
Summary
Callbacks
Returns a child specification for processes this adapter needs, if any.
Callbacks
@callback child_spec(config :: Keyword.t(), cloud_module :: module()) :: Supervisor.child_spec() | {:error, term()}
Returns a child specification for processes this adapter needs, if any.
This callback is optional. Adapters that need supervised processes (like GCS auth servers) should implement this callback. Adapters that don't need any supervised processes (like Volume, S3) can omit this callback entirely.
When implemented, should return:
child_spec()
- A supervisor child specification{:error, reason}
- Config is invalid
Examples:
- GCS adapter implements this to return auth server child spec
- Volume/S3 adapters don't implement this callback at all
Link to this callback
delete(binary, t)
Link to this callback
get(binary, t)
Link to this callback
put(t, binary, t)
@callback put(Buckets.Object.t(), binary(), Keyword.t()) :: {:ok, map()} | {:error, term()}
Link to this callback
url(binary, t)
@callback url(binary(), Keyword.t()) :: {:ok, Buckets.SignedURL.t()}
Link to this callback
validate_config(t)
Functions
Link to this function