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:
parent
f4f6feafb3
commit
ee8b369a19
@ -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",
|
@ -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)
|
||||
}
|
||||
|
@ -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...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user