feat(core): add system store service interface

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-08-28 20:18:18 -04:00
parent 52166feca2
commit f0598412f3
6 changed files with 230 additions and 0 deletions
@@ -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;
}