Adds DELETE.
Fixes #11 Change-Id: I3b4aadc85055f2d2f4efb9e2e95bde6924320f35
This commit is contained in:
@@ -21,6 +21,7 @@ func Valid(p string, packages []Package) bool {
|
||||
|
||||
// Storage is a shim to allow for alternate storage types.
|
||||
type Storage interface {
|
||||
Contains(name string) bool
|
||||
Add(p Package) error
|
||||
Remove(path string) error
|
||||
All() []Package
|
||||
@@ -43,6 +44,11 @@ func NewSimpleStore(path string) *SimpleStore {
|
||||
}
|
||||
}
|
||||
|
||||
func (ms *SimpleStore) Contains(name string) bool {
|
||||
_, contains := ms.p[name]
|
||||
return contains
|
||||
}
|
||||
|
||||
// Add adds p to the SimpleStore.
|
||||
func (ms *SimpleStore) Add(p Package) error {
|
||||
ms.l.Lock()
|
||||
|
||||
Reference in New Issue
Block a user