diff options
Diffstat (limited to 'store.go')
-rw-r--r-- | store.go | 22 |
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 +} |