Rename Dump to Sync

This commit is contained in:
Asim Aslam 2019-10-03 09:56:25 +01:00
parent a9c85eda68
commit b5f33b2aaa
4 changed files with 5 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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