AgentSessionManager.Adapters.S3ArtifactStore.S3Client behaviour (AgentSessionManager v0.8.0)

Copy Markdown View Source

Behaviour for S3 API operations.

This behaviour abstracts the S3 client to allow mocking in tests. The default implementation uses ExAws.S3.

Custom Implementations

You can provide your own implementation:

{:ok, store} = S3ArtifactStore.start_link(
  bucket: "my-bucket",
  client: MyCustomS3Client
)

Summary

Types

key()

@type key() :: String.t()

Callbacks

delete_object(bucket, key, opts)

@callback delete_object(bucket :: String.t(), key(), opts :: keyword()) ::
  :ok | {:error, term()}

get_object(bucket, key, opts)

@callback get_object(bucket :: String.t(), key(), opts :: keyword()) ::
  {:ok, binary()} | {:error, term()}

put_object(bucket, key, data, opts)

@callback put_object(bucket :: String.t(), key(), data :: binary(), opts :: keyword()) ::
  :ok | {:error, term()}