Profile DSL used to declare upload policy and variant recipes.
Profiles are validated at compile time so invalid configuration fails fast before runtime upload and processing flows execute.
Summary
Functions
Declares a Rindle profile.
Types
@type variant_entry() :: {atom(), variant_spec()}
Functions
Declares a Rindle profile.
When used, this macro validates the supplied options at compile time and
generates the storage_adapter/0, variants/0, upload_policy/0,
validate_upload/1, delivery_policy/0, and recipe_digest/1 functions
that the rest of Rindle dispatches through.
Example
defmodule MyApp.AvatarProfile do
use Rindle.Profile,
storage: Rindle.Storage.S3,
allow_mime: ["image/png", "image/jpeg"],
max_bytes: 10_000_000,
delivery: %{public: false, signed_url_ttl_seconds: 900},
variants: %{thumb: %{width: 128, height: 128, format: :webp}}
end