blob: 3fb279f529e5f80ce93606c98ffbb479cf80b2ae (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
}
|