Adds DELETE.

Fixes #11

Change-Id: I3b4aadc85055f2d2f4efb9e2e95bde6924320f35
This commit is contained in:
sm
2016-03-01 23:50:08 -08:00
parent ce00d933aa
commit 2e4add8a1c
3 changed files with 66 additions and 1 deletions
+6
View File
@@ -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()