Capsule v1.0.0 Capsule.Storage behaviour View Source
Defines the behaviour for storage backends.
Implement this behaviour to create a storage adapter that can read, write, stream, and delete files.
Link to this section Summary
Link to this section Types
Link to this section Callbacks
Specs
delete(locator_id()) :: :ok | error()
Specs
delete(locator_id(), [option()]) :: :ok | error()
Specs
put(Capsule.Upload.t()) :: {:ok, locator_id()} | error()
Specs
put(Capsule.Upload.t(), [option()]) :: {:ok, locator_id()} | error()
Specs
read(locator_id()) :: {:ok, binary()} | error()
Specs
read(locator_id(), [option()]) :: {:ok, binary()} | error()
Specs
stream!(locator_id()) :: Enumerable.t()
Specs
stream!(locator_id(), [option()]) :: Enumerable.t()