Skip to main content

BaseKeyValueStoreClient

Abstract base class for key-value store resource clients.

These clients are specific to the type of resource they manage and operate under a designated storage client, like a memory storage client.

Hierarchy

Index

Methods

delete

  • async delete(): None
  • Permanently delete the key-value store managed by this client.


    Returns None

delete_record

  • async delete_record(key): None
  • Delete the specified record from the key-value store.


    Parameters

    • key: str

      The key of the record which to delete

    Returns None

get

  • async get(): KeyValueStoreMetadata | None
  • Get metadata about the key-value store being managed by this client.


    Returns KeyValueStoreMetadata | None

get_public_url

  • async get_public_url(key): str
  • Get the public URL for the given key.


    Parameters

    • key: str

      Key of the record for which URL is required.

    Returns str

    The public URL for the given key.

get_record

  • async get_record(key): KeyValueStoreRecord | None
  • Retrieve the given record from the key-value store.


    Parameters

    • key: str

      Key of the record to retrieve

    Returns KeyValueStoreRecord | None

    The requested record, or None, if the record does not exist

get_record_as_bytes

  • async get_record_as_bytes(key): KeyValueStoreRecord[bytes] | None
  • Retrieve the given record from the key-value store, without parsing it.


    Parameters

    • key: str

      Key of the record to retrieve

    Returns KeyValueStoreRecord[bytes] | None

    The requested record, or None, if the record does not exist

list_keys

  • List the keys in the key-value store.


    Parameters

    • keyword-onlylimit: int = 1000

      Number of keys to be returned. Maximum value is 1000.

    • keyword-onlyexclusive_start_key: str | None = None

      All keys up to this one (including) are skipped from the result.

    Returns KeyValueStoreListKeysPage

    The list of keys in the key-value store matching the given arguments.

set_record

  • async set_record(key, value, content_type): None
  • Set a value to the given record in the key-value store.


    Parameters

    • key: str

      The key of the record to save the value to

    • value: Any

      The value to save into the record

    • content_type: str | None = None

      The content type of the saved value

    Returns None

stream_record

  • async stream_record(key): AsyncContextManager[KeyValueStoreRecord[Response] | None]
  • Retrieve the given record from the key-value store, as a stream.


    Parameters

    • key: str

      Key of the record to retrieve

    Returns AsyncContextManager[KeyValueStoreRecord[Response] | None]

    The requested record as a context-managed streaming Response, or None, if the record does not exist

update

  • Update the key-value store metadata.


    Parameters

    • keyword-onlyname: str | None = None

      New new name for the key-value store.

    Returns KeyValueStoreMetadata

    An object reflecting the updated key-value store metadata.