f0598412f3
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KTXF\SystemStore\Service;
|
|
|
|
use KTXF\Resource\BinaryResource;
|
|
use KTXF\Resource\Provider\ResourceServiceBaseInterface;
|
|
use KTXF\SystemStore\BlobInfo;
|
|
use KTXF\SystemStore\WriteCondition;
|
|
|
|
/**
|
|
* Basic key-addressed storage contract for tenant-owned system data.
|
|
*/
|
|
interface SystemStoreServiceInterface extends ResourceServiceBaseInterface
|
|
{
|
|
public const JSON_TYPE = 'system-store:service';
|
|
|
|
public function stat(string $key): ?BlobInfo;
|
|
|
|
public function read(string $key): ?BinaryResource;
|
|
|
|
public function write(
|
|
string $key,
|
|
BinaryResource $content,
|
|
array $metadata = [],
|
|
?WriteCondition $condition = null,
|
|
): BlobInfo;
|
|
|
|
public function delete(
|
|
string $key,
|
|
?WriteCondition $condition = null,
|
|
): bool;
|
|
|
|
/**
|
|
* Iterates stored metadata lazily. Implementations must keep memory use
|
|
* bounded and handle any backend pagination internally.
|
|
*
|
|
* @return iterable<BlobInfo>
|
|
*/
|
|
public function list(string $prefix = ''): iterable;
|
|
}
|