From 56e01e724e0104fb408c8b7d82ec3101aff67150 Mon Sep 17 00:00:00 2001 From: Igor Shishkin Date: Sun, 7 Jul 2024 12:12:19 +0300 Subject: [PATCH] Add metadata repo interface skeleton (#8) --- repositories/metadata/metadata.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 repositories/metadata/metadata.go diff --git a/repositories/metadata/metadata.go b/repositories/metadata/metadata.go new file mode 100644 index 0000000..0382f73 --- /dev/null +++ b/repositories/metadata/metadata.go @@ -0,0 +1,21 @@ +package metadata + +import "context" + +type Repository interface { + CreateContainer(ctx context.Context, name string) error + ListContainers(ctx context.Context) ([]string, error) + DeleteContainer(ctx context.Context, name string) error + + CreateVersion(ctx context.Context, container string) (string, error) + ListAllVersionsByContainer(ctx context.Context, container string) ([]string, error) + ListPublishedVersionsByContainer(ctx context.Context, container string) ([]string, error) + MarkVersionPublished(ctx context.Context, container, version string) error + + CreateObject(ctx context.Context, container, version, key, casKey string) error + ListObjects(ctx context.Context, container, version, key string) ([]string, error) + DeleteObject(ctx context.Context, container, version, key string) error + RemapObject(ctx context.Context, container, version, key, newCASKey string) error + + CreateBLOB(ctx context.Context, checksum string, size uint64, mimeType string) error +}