From 2566cfae03199f8e90098c84b712d48182d9b806 Mon Sep 17 00:00:00 2001 From: Estevan Castilho Date: Thu, 9 Jul 2026 00:33:37 +0000 Subject: Interface for the storage layer --- lib/abstract/Storage.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 lib/abstract/Storage.ml (limited to 'lib/abstract/Storage.ml') diff --git a/lib/abstract/Storage.ml b/lib/abstract/Storage.ml new file mode 100644 index 0000000..d0f2097 --- /dev/null +++ b/lib/abstract/Storage.ml @@ -0,0 +1,18 @@ +module type STORAGE = sig + type connection + type transaction + + val connect: Concepts.Configuration.configuration -> connection + + (** begin a transaction within `connection` *) + val start: connection -> transaction + (** `commit` the current transaction *) + val commit: transaction -> () + (** `abort` the current transaction *) + val abort: transaction -> () + + (** within a transaction, fetch a blob from disk *) + val get: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob + (** within a transaction, associate a hash with a blob on disk *) + val put: transaction -> Concepts.Hash.hash -> Concepts.Representation.blob -> () +end -- cgit v1.2.3