1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-30 10:10:44 +02:00

add initialisers

This commit is contained in:
Asim Aslam 2020-12-29 16:50:18 +00:00
parent f4f6feafb3
commit ee8b369a19
3 changed files with 10 additions and 2 deletions

View File

@ -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",

View File

@ -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)
}

View File

@ -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...)
}