DepotS3 (Depot S3 v0.1.4) View Source

Depot Adapter for the local filesystem.

Direct usage

config = [
  access_key_id: "key",
  secret_access_key: "secret",
  scheme: "https://",
  region: "eu-west-1",
  host: "s3.eu-west-1.amazonaws.com",
  port: 443
]
filesystem = DepotS3.configure(config: config, bucket: "default")
:ok = Depot.write(filesystem, "test.txt", "Hello World")
{:ok, "Hello World"} = Depot.read(filesystem, "test.txt")

Usage with a module

defmodule S3FileSystem do
  use Depot,
    adapter: DepotS3,
    bucket: "default",
    config: [
      access_key_id: "key",
      secret_access_key: "secret",
      scheme: "https://",
      region: "eu-west-1",
      host: "s3.eu-west-1.amazonaws.com",
      port: 443
    ]
end

S3FileSystem.write("test.txt", "Hello World")
{:ok, "Hello World"} = S3FileSystem.read("test.txt")