From b5f33b2aaa61e664213882b0f53197f1cc35749e Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 3 Oct 2019 09:56:25 +0100 Subject: [PATCH] Rename Dump to Sync --- store/etcd/etcd.go | 2 +- store/memory/memory.go | 2 +- store/store.go | 4 ++-- sync/map.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/store/etcd/etcd.go b/store/etcd/etcd.go index 32994f26..7d866d63 100644 --- a/store/etcd/etcd.go +++ b/store/etcd/etcd.go @@ -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 diff --git a/store/memory/memory.go b/store/memory/memory.go index c8e7dd53..a7d5a83c 100644 --- a/store/memory/memory.go +++ b/store/memory/memory.go @@ -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() diff --git a/store/store.go b/store/store.go index e7241591..c6442947 100644 --- a/store/store.go +++ b/store/store.go @@ -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 diff --git a/sync/map.go b/sync/map.go index 5913267b..a87bd988 100644 --- a/sync/map.go +++ b/sync/map.go @@ -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 }