Capsule v1.0.0 Capsule.Locator View Source
A struct that identifies an uploaded file by its storage location.
Contains the file's ID within the storage backend, the storage module, and arbitrary metadata.
Link to this section Summary
Functions
Creates a new Capsule.Locator from the given attributes.
Returns {:ok, locator} on success or {:error, reason} on failure.
Same as new/1, but raises Capsule.Errors.InvalidLocator instead of returning an error tuple.
Link to this section Types
Specs
Link to this section Functions
Specs
Creates a new Capsule.Locator from the given attributes.
Returns {:ok, locator} on success or {:error, reason} on failure.
Accepts a keyword list or map with :id and :storage keys, or string keys
"id" and "storage".
Specs
Same as new/1, but raises Capsule.Errors.InvalidLocator instead of returning an error tuple.