(data []byte)
| 11 | } |
| 12 | |
| 13 | func (w *Wal) Write(data []byte) error { |
| 14 | index, err := w.log.LastIndex() |
| 15 | if err != nil { |
| 16 | return err |
| 17 | } |
| 18 | return w.log.Write(index+1, data) |
| 19 | } |
| 20 | |
| 21 | func (w *Wal) Read(index uint64) ([]byte, error) { |
| 22 | return w.log.Read(index) |