keepluggable.storage_file.local module¶
A simple local filesystem storage backend.
- class keepluggable.storage_file.local.LocalConfigSchema(*args, **kw)[source]¶
Bases:
colander.Schema
Validated configuration for LocalStorage.
- class keepluggable.storage_file.local.LocalFilesystemPower(orchestrator: keepluggable.orchestrator.Orchestrator)[source]¶
Bases:
keepluggable.storage_file.local.LocalStorage
A subclass that contains dangerous methods.
- class keepluggable.storage_file.local.LocalStorage(orchestrator: keepluggable.orchestrator.Orchestrator)[source]¶
Bases:
keepluggable.storage_file.BasePayloadStorage
Local filesystem storage backend.
You should use this for testing only because it is not very robust. It stores files in a very simple directory scheme:
base_storage_directory / namespace / key
Performance will suffer as soon as a couple of thousand files are stored in a namespace.
Keys are MD5 hashes by default. To change this, you would modify the action, not the storage backend.
To enable this backend, use this configuration:
cls_storage_file = keepluggable.storage_file.local.LocalStorage
Configuration settings
Specify in which directory to store payloads like this:
local_storage_path = some.python.resource:relative/directory
- get_reader(namespace: str, metadata: Dict[str, Any]) BinaryIO [source]¶
Return a stream for the file content.
- get_superpowers() keepluggable.storage_file.local.LocalFilesystemPower [source]¶
Get a really dangerous subclass instance.