mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
wal: named return values for ReadAll.
This commit is contained in:
@@ -141,14 +141,10 @@ func OpenFromIndex(dirpath string, index int64) (*WAL, error) {
|
||||
|
||||
// ReadAll reads out all records of the current WAL.
|
||||
// After ReadAll, the WAL will be ready for appending new records.
|
||||
func (w *WAL) ReadAll() (int64, raftpb.State, []raftpb.Entry, error) {
|
||||
var id int64
|
||||
var state raftpb.State
|
||||
var entries []raftpb.Entry
|
||||
|
||||
func (w *WAL) ReadAll() (id int64, state raftpb.State, entries []raftpb.Entry, err error) {
|
||||
rec := &walpb.Record{}
|
||||
decoder := w.decoder
|
||||
var err error
|
||||
|
||||
for err = decoder.decode(rec); err == nil; err = decoder.decode(rec) {
|
||||
switch rec.Type {
|
||||
case entryType:
|
||||
|
||||
Reference in New Issue
Block a user