# `Plato.Storage.Adapter`
[🔗](https://github.com/lassediercks/plato/blob/v0.0.24/lib/plato/storage/adapter.ex#L1)

Behaviour for storage adapters in Plato CMS.

Allows pluggable storage backends (S3, local filesystem, etc.)

# `config`

```elixir
@type config() :: keyword()
```

# `storage_path`

```elixir
@type storage_path() :: String.t()
```

# `upload`

```elixir
@type upload() :: %{filename: String.t(), path: String.t(), content_type: String.t()}
```

# `url`

```elixir
@type url() :: String.t()
```

# `delete`

```elixir
@callback delete(storage_path(), config()) :: :ok | {:error, term()}
```

Delete a file from storage

# `exists?`

```elixir
@callback exists?(storage_path(), config()) :: boolean()
```

Check if a file exists in storage

# `get_url`

```elixir
@callback get_url(storage_path(), config()) :: {:ok, url()} | {:error, term()}
```

Get a URL for accessing the stored file

# `put`

```elixir
@callback put(upload(), storage_path(), config()) ::
  {:ok, storage_path()} | {:error, term()}
```

Upload a file to storage

---

*Consult [api-reference.md](api-reference.md) for complete listing*
