diff --git a/store/memory.go b/store/memory.go index d4e2351..089fd12 100644 --- a/store/memory.go +++ b/store/memory.go @@ -8,6 +8,8 @@ import ( "github.com/google/uuid" ) +var _ Store = &MemoryStore{} + type MemoryStore struct { data map[string][]byte } @@ -44,3 +46,12 @@ func (s *MemoryStore) Get(id string) (io.ReadCloser, error) { return r, nil } + +func (s *MemoryStore) List() ([]string, error) { + var ids []string + for id := range s.data { + ids = append(ids, id) + } + + return ids, nil +} diff --git a/store/store.go b/store/store.go index c4482d6..b086c59 100644 --- a/store/store.go +++ b/store/store.go @@ -11,4 +11,5 @@ type Store interface { Add(r io.Reader) (string, error) Delete(id string) error Get(id string) (io.ReadCloser, error) + List() ([]string, error) }