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
|
||||
}
|
||||
|
||||
func (e *ekv) Dump() ([]*store.Record, error) {
|
||||
func (e *ekv) Sync() ([]*store.Record, error) {
|
||||
keyval, err := e.kv.Get(context.Background(), "/", client.WithPrefix())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -21,7 +21,7 @@ type memoryRecord struct {
|
||||
c time.Time
|
||||
}
|
||||
|
||||
func (m *memoryStore) Dump() ([]*store.Record, error) {
|
||||
func (m *memoryStore) Sync() ([]*store.Record, error) {
|
||||
m.RLock()
|
||||
defer m.RUnlock()
|
||||
|
||||
|
@ -16,8 +16,8 @@ var (
|
||||
type Store interface {
|
||||
// embed options
|
||||
options.Options
|
||||
// Dump the known records
|
||||
Dump() ([]*Record, error)
|
||||
// Sync all the known records
|
||||
Sync() ([]*Record, error)
|
||||
// Read a record with key
|
||||
Read(key string) (*Record, error)
|
||||
// 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 {
|
||||
keyvals, err := m.opts.Store.Dump()
|
||||
keyvals, err := m.opts.Store.Sync()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user