diff --git a/store/default.go b/store/memory.go similarity index 98% rename from store/default.go rename to store/memory.go index f983d917..cda250cb 100644 --- a/store/default.go +++ b/store/memory.go @@ -10,8 +10,8 @@ import ( "github.com/pkg/errors" ) -// NewStore returns a memory store -func NewStore(opts ...Option) Store { +// NewMemoryStore returns a memory store +func NewMemoryStore(opts ...Option) Store { s := &memoryStore{ options: Options{ Database: "micro", diff --git a/store/noop.go b/store/noop.go index 25d4850a..4bc3c578 100644 --- a/store/noop.go +++ b/store/noop.go @@ -33,3 +33,7 @@ func (n *noopStore) List(opts ...ListOption) ([]string, error) { func (n *noopStore) Close() error { return nil } + +func NewNoopStore(opts ...Option) Store { + return new(noopStore) +} diff --git a/store/store.go b/store/store.go index 3c475d19..d46b7b7a 100644 --- a/store/store.go +++ b/store/store.go @@ -45,3 +45,7 @@ type Record struct { // Time to expire a record: TODO: change to timestamp Expiry time.Duration `json:"expiry,omitempty"` } + +func NewStore(opts ...Option) Store { + return NewMemoryStore(opts...) +}