# granite_storage.contracts

class granite_storage.contracts.StorageBackend(*args, **kwargs)

  Bases: `Protocol`

  __init__(*args, **kwargs)
  backend_name: str
  delete(ref: StoredObjectRef) → None
  exists(ref: StoredObjectRef) → bool
  get(ref: StoredObjectRef) → bytes
  iter_locations(prefix: str | None = None) → Iterator[str]
  open(ref: StoredObjectRef) → BinaryIO
  put_bytes(*, key: str, content: bytes, content_type: str | None = None, original_filename: str | None = None, extra: dict[str, Any] | None = None) → StoredObjectRef
  put_stream(*, key: str, stream: BinaryIO, size: int | None = None, checksum: str | None = None, content_type: str | None = None, original_filename: str | None = None, extra: dict[str, Any] | None = None) → StoredObjectRef