feat(core): add system store service interface
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?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;
|
||||
}
|
||||
Reference in New Issue
Block a user