MemoryStorage

In-memory storage: nothing touches the disk.

On this page

Class in sponsorkit.storage.

from sponsorkit import MemoryStorage

Also importable from sponsorkit.storage.

class MemoryStorage:
    ...

In-memory storage: nothing touches the disk. Useful for tests and ephemeral environments.

Constructor#

MemoryStorage() -> None

Methods#

read()#

def read(self, key: str) -> str | None

Return the stored value.

write()#

def write(self, key: str, data: str) -> None

Replace the stored value.

delete()#

def delete(self, key: str) -> None

Remove the stored value.