Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

Commit

Permalink
fix: Make MockStore implement Store interface
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Trider <[email protected]>
  • Loading branch information
Derek Trider committed Feb 24, 2020
1 parent 6de326a commit da7e594
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/storage/mockstore/mockstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
// Provider mock store provider.
type Provider struct {
Store *MockStore
ErrCreateStore error
ErrOpenStoreHandle error
FailNameSpace string
}
Expand All @@ -27,6 +28,11 @@ func NewMockStoreProvider() *Provider {
}}
}

// CreateStore creates a new store with the given name.
func (p *Provider) CreateStore(name string) error {
return p.ErrCreateStore
}

// OpenStore opens and returns a store for given name space.
func (p *Provider) OpenStore(name string) (storage.Store, error) {
if name == p.FailNameSpace {
Expand Down

0 comments on commit da7e594

Please sign in to comment.