# `Waffle.Storage`
[🔗](https://github.com/elixir-waffle/waffle/blob/v2.0.0/lib/waffle/behaviors/storage.ex#L1)

Defines the behavior for file storage.

## Callbacks

- `put/3`: Saves a file and returns the file name or an error.
- `url/3`: Generates a URL for accessing a file.
- `delete/3`: Deletes a file and returns the result of the operation.

# `delete`

```elixir
@callback delete(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  atom()
```

# `put`

```elixir
@callback put(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  {:ok, file_name :: String.t()} | {:error, reason :: any()}
```

# `url`

```elixir
@callback url(
  definition :: atom(),
  version :: atom(),
  file_and_scope :: {Waffle.File.t(), any()}
) ::
  String.t()
```

---

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