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 }