Ecto schema for a direct upload session.
A MediaUploadSession tracks the lifecycle of a direct-to-storage
upload — from the moment Rindle issues a presigned PUT URL through
verification of the uploaded object.
States
| State | Meaning |
|---|---|
"initialized" | Session created; no presigned URL yet. |
"signed" | Presigned PUT URL issued to client. |
"uploading" | Client has begun (or is presumed to have begun) the PUT. |
"uploaded" | Storage reports the object exists at the expected key. |
"verifying" | Server-side validation (MIME, size) in progress. |
"completed" | Verification passed; asset promoted. |
"aborted" | Client cancelled or server rejected. |
"expired" | TTL elapsed before completion. |
"failed" | Verification failed (MIME mismatch, size limit, scanner). |
See the state table below for the supported transitions and
Rindle.Upload.Broker for the lifecycle entry points.
Summary
Functions
Builds a changeset for an upload-session row.
Types
@type t() :: %Rindle.Domain.MediaUploadSession{ __meta__: term(), asset: term(), asset_id: term(), expires_at: term(), failure_reason: term(), id: term(), inserted_at: term(), last_known_offset: term(), multipart_parts: term(), multipart_upload_id: term(), region_hint: term(), session_uri: term(), session_uri_expires_at: term(), state: term(), updated_at: term(), upload_key: term(), upload_strategy: term(), verified_at: term() }
Functions
@spec changeset( t() | %Rindle.Domain.MediaUploadSession{ __meta__: term(), asset: term(), asset_id: term(), expires_at: term(), failure_reason: term(), id: term(), inserted_at: term(), last_known_offset: term(), multipart_parts: term(), multipart_upload_id: term(), region_hint: term(), session_uri: term(), session_uri_expires_at: term(), state: term(), updated_at: term(), upload_key: term(), upload_strategy: term(), verified_at: term() }, map() ) :: Ecto.Changeset.t()
Builds a changeset for an upload-session row.
Casts the lifecycle, multipart, and verification columns; requires the
minimum invariants (:asset_id, :state, :upload_key, :upload_strategy,
:expires_at); validates the lifecycle state against the canonical state
list.