Skip to content

Commit

Permalink
add initialisers
Browse files Browse the repository at this point in the history
  • Loading branch information
asim committed Dec 29, 2020
1 parent f4f6fea commit ee8b369
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions store/default.go → store/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions store/noop.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
4 changes: 4 additions & 0 deletions store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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...)
}

0 comments on commit ee8b369

Please sign in to comment.