ExStorageService.BlobStore behaviour (ex_storage_service v0.6.2)

Copy Markdown View Source

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

hash()

@type hash() :: String.t()

options()

@type options() :: keyword()

range()

@type range() :: nil | :all | {non_neg_integer(), non_neg_integer()}

Callbacks

commit(t, options)

delete(hash, options)

@callback delete(hash(), options()) :: :ok | {:error, term()}

discard(t, options)

@callback discard(ExStorageService.BlobStore.StagedBlob.t(), options()) ::
  :ok | {:error, term()}

open(hash, range, options)

@callback open(hash(), range(), options()) ::
  {:ok, ExStorageService.BlobStore.Source.t()} | {:error, term()}

stage(arg1, options)

@callback stage(Enumerable.t() | binary(), options()) ::
  {:ok, ExStorageService.BlobStore.StagedBlob.t()} | {:error, term()}

stat(hash, options)

@callback stat(hash(), options()) :: {:ok, map()} | {:error, term()}

verify(hash, options)

@callback verify(hash(), options()) :: :ok | {:error, term()}