Rename Dump to Sync
This commit is contained in:
parent
a9c85eda68
commit
b5f33b2aaa
@ -41,7 +41,7 @@ func (e *ekv) Write(record *store.Record) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *ekv) Dump() ([]*store.Record, error) {
|
func (e *ekv) Sync() ([]*store.Record, error) {
|
||||||
keyval, err := e.kv.Get(context.Background(), "/", client.WithPrefix())
|
keyval, err := e.kv.Get(context.Background(), "/", client.WithPrefix())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -21,7 +21,7 @@ type memoryRecord struct {
|
|||||||
c time.Time
|
c time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *memoryStore) Dump() ([]*store.Record, error) {
|
func (m *memoryStore) Sync() ([]*store.Record, error) {
|
||||||
m.RLock()
|
m.RLock()
|
||||||
defer m.RUnlock()
|
defer m.RUnlock()
|
||||||
|
|
||||||
|
@ -16,8 +16,8 @@ var (
|
|||||||
type Store interface {
|
type Store interface {
|
||||||
// embed options
|
// embed options
|
||||||
options.Options
|
options.Options
|
||||||
// Dump the known records
|
// Sync all the known records
|
||||||
Dump() ([]*Record, error)
|
Sync() ([]*Record, error)
|
||||||
// Read a record with key
|
// Read a record with key
|
||||||
Read(key string) (*Record, error)
|
Read(key string) (*Record, error)
|
||||||
// Write a record
|
// Write a record
|
||||||
|
@ -85,7 +85,7 @@ func (m *syncMap) Delete(key interface{}) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *syncMap) Iterate(fn func(key, val interface{}) error) error {
|
func (m *syncMap) Iterate(fn func(key, val interface{}) error) error {
|
||||||
keyvals, err := m.opts.Store.Dump()
|
keyvals, err := m.opts.Store.Sync()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user