aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/ObjectManager.ml37
-rw-r--r--lib/StorageBackend.ml11
-rw-r--r--lib/dune4
-rw-r--r--lib/rnt.ml3
4 files changed, 55 insertions, 0 deletions
diff --git a/lib/ObjectManager.ml b/lib/ObjectManager.ml
new file mode 100644
index 0000000..b107b4e
--- /dev/null
+++ b/lib/ObjectManager.ml
@@ -0,0 +1,37 @@
+type multigroup = {merkle_root: string}
+type relation = {merkle_root: string}
+type ephemeral_relation = {merkle_root: string; dependencies: string BatFingerTree.t}
+type transaction = unit
+type session = {connection_context: unit; branch_overrides: string BatMap.String.t}
+type branch = {name: string; target_hash: string}
+type branch_tree = {merkle_root: string}
+
+type rnt_object_kind =
+ | Multigroup of multigroup
+ | Relation of relation
+ | EphemeralRelation of ephemeral_relation
+ | Session of session
+ | Branch of branch
+ | BranchTree of branch_tree
+
+type rnt_method = OPEN | CLOSE
+
+type rnt_object =
+ {kind: rnt_object_kind; disposable: bool; methods: rnt_method BatSet.t; exclsive: bool}
+
+type registry = {reference_count: int; handle_count: int; entry: rnt_object}
+
+type rnt_object_tree =
+ | Intermediary of {label: string; data: registry; subsequent: rnt_object_tree BatFingerTree.t}
+ | Final of {label: string; data: registry}
+
+let register (_object_path : string BatFingerTree.t) (_registry : rnt_object_tree)
+ (_rnt_object : rnt_object) : rnt_object_tree =
+ failwith "NOT IMPLEMENTED"
+
+let find (_object_path : string BatFingerTree.t) (_registry : rnt_object_tree) : registry =
+ failwith "NOT IMPLEMENTED"
+
+let unregister (_object_path : string BatFingerTree.t) (_registry : rnt_object_tree) :
+ rnt_object_tree =
+ failwith "NOT IMPLEMENTED"
diff --git a/lib/StorageBackend.ml b/lib/StorageBackend.ml
new file mode 100644
index 0000000..0e7106b
--- /dev/null
+++ b/lib/StorageBackend.ml
@@ -0,0 +1,11 @@
+module type T = sig
+ val put: bytes -> string
+ val get: string -> bytes option
+end
+
+module SQLite: T = struct
+ let put (_value: bytes) =
+ failwith "NOT IMPLEMENTED"
+ let get (_hash: string) =
+ failwith "NOT IMPLEMENTED"
+end
diff --git a/lib/dune b/lib/dune
new file mode 100644
index 0000000..7ab7df1
--- /dev/null
+++ b/lib/dune
@@ -0,0 +1,4 @@
+(library
+ (name rnt)
+ (public_name rnt)
+ (libraries batteries))
diff --git a/lib/rnt.ml b/lib/rnt.ml
new file mode 100644
index 0000000..7192e6b
--- /dev/null
+++ b/lib/rnt.ml
@@ -0,0 +1,3 @@
+(** RNT: Relations, Not Tables. *)
+
+let version = "0.1.0"