Added FUSE support #55
@ -1,6 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"go.arsenm.dev/logger"
|
||||
"go.arsenm.dev/logger/log"
|
||||
"os"
|
||||
"context"
|
||||
@ -241,7 +242,7 @@ type bytesFileWriteHandle struct {
|
||||
|
||||
var _ = (fs.FileWriter)((*bytesFileWriteHandle)(nil))
|
||||
func (fh *bytesFileWriteHandle) Write(ctx context.Context, data []byte, off int64) (written uint32, errno syscall.Errno) {
|
||||
log.Info("Executing Write").Str("path", fh.path).Int("size", len(fh.content)).Send()
|
||||
log.Info("Executing Write").Str("path", fh.path).Int("prev_size", len(fh.content)).Int("next_size", len(data)).Send()
|
||||
if off != int64(len(fh.content)) {
|
||||
}
|
||||
fh.content = append(fh.content[:], data[:]...)
|
||||
@ -483,6 +484,11 @@ func (f *ITNode) Rmdir(ctx context.Context, name string) syscall.Errno {
|
||||
return f.Unlink(ctx, name)
|
||||
}
|
||||
|
||||
func init() {
|
||||
// Default logger is JSONLogger going to stderr
|
||||
log.Logger = logger.NewPretty(os.Stdout)
|
||||
}
|
||||
|
||||
func main() {
|
||||
// This is where we'll mount the FS
|
||||
mntDir := "/tmp/x"
|
||||
|
Loading…
Reference in New Issue
Block a user