aboutsummaryrefslogtreecommitdiffstats
path: root/store.go
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2012-04-07 20:17:47 -0400
committerbnewbold <bnewbold@robocracy.org>2012-04-07 20:19:49 -0400
commit3c7a4451e62d27bbe9dc8eb2c16e2ff5607d1b04 (patch)
treecd488373455a7363d5d345672a007eaee8798070 /store.go
parent6bbc3e9939e9e168e7cb0265f5d643b2d83943ae (diff)
downloadbommom-3c7a4451e62d27bbe9dc8eb2c16e2ff5607d1b04.tar.gz
bommom-3c7a4451e62d27bbe9dc8eb2c16e2ff5607d1b04.zip
backup of partial progress
Diffstat (limited to 'store.go')
-rw-r--r--store.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/store.go b/store.go
new file mode 100644
index 0000000..3fb279f
--- /dev/null
+++ b/store.go
@@ -0,0 +1,22 @@
+package main
+
+var bomstore BomStore
+
+// TODO: who owns returned BOMs? Caller? need "free" methods?
+type BomStore interface {
+ GetStub(user, name ShortName) (*BomStub, error)
+ GetHead(user, name ShortName) (*Bom, error)
+ GetBom(user, name, version ShortName) (*Bom, error)
+ Persist(bom *Bom) error
+}
+
+/*
+// Dummy BomStore backed by hashtable in memory, for testing and demo purposes
+type MemoryBomStore map[string] Bom
+*/
+
+// Basic BomStore backend using a directory structure of JSON files saved to
+// disk.
+type JSONFileBomStore struct {
+ rootPath string
+}