Behaviour for durable, content-addressed blob storage.
Implementations stage bytes before publishing them so object metadata is never required to point at a partially written file.
Summary
Types
@type hash() :: String.t()
@type options() :: keyword()
@type range() :: nil | :all | {non_neg_integer(), non_neg_integer()}
Callbacks
@callback commit(ExStorageService.BlobStore.StagedBlob.t(), options()) :: {:ok, ExStorageService.BlobStore.ReadyBlob.t()} | {:error, term()}
@callback discard(ExStorageService.BlobStore.StagedBlob.t(), options()) :: :ok | {:error, term()}
@callback open(hash(), range(), options()) :: {:ok, ExStorageService.BlobStore.Source.t()} | {:error, term()}
@callback stage(Enumerable.t() | binary(), options()) :: {:ok, ExStorageService.BlobStore.StagedBlob.t()} | {:error, term()}