change store options
This commit is contained in:
@@ -5,12 +5,11 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/micro/go-micro/config/options"
|
||||
"github.com/micro/go-micro/store"
|
||||
)
|
||||
|
||||
type memoryStore struct {
|
||||
options.Options
|
||||
options store.Options
|
||||
|
||||
sync.RWMutex
|
||||
values map[string]*memoryRecord
|
||||
@@ -110,11 +109,14 @@ func (m *memoryStore) Delete(keys ...string) error {
|
||||
}
|
||||
|
||||
// NewStore returns a new store.Store
|
||||
func NewStore(opts ...options.Option) store.Store {
|
||||
options := options.NewOptions(opts...)
|
||||
func NewStore(opts ...store.Option) store.Store {
|
||||
var options store.Options
|
||||
for _, o := range opts {
|
||||
o(&options)
|
||||
}
|
||||
|
||||
return &memoryStore{
|
||||
Options: options,
|
||||
options: options,
|
||||
values: make(map[string]*memoryRecord),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user