Add WALHeader & WALFrameHeader

This commit is contained in:
Ben Johnson
2020-10-22 14:53:14 -06:00
parent 8fa4727358
commit dc3da53c76
8 changed files with 438 additions and 1 deletions

View File

@@ -2,7 +2,9 @@ package litestream
import (
"context"
"encoding/hex"
"io"
"log"
"os"
"sort"
"syscall"
@@ -51,6 +53,9 @@ func (h *Handle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.Rea
// Write writes data at a given offset to the underlying file.
func (h *Handle) Write(ctx context.Context, req *fuse.WriteRequest, resp *fuse.WriteResponse) (err error) {
log.Printf("write: name=%s offset=%d", h.f.Name(), req.Offset)
println(hex.Dump(req.Data))
resp.Size, err = h.f.WriteAt(req.Data, req.Offset)
return err
}