Skip to content

Commit

Permalink
upgrade fuse afero & change example
Browse files Browse the repository at this point in the history
  • Loading branch information
0x587 committed May 9, 2024
1 parent 791a5fd commit a2a7a12
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 454 deletions.
21 changes: 12 additions & 9 deletions example/osfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@ package main
import (
"flag"
"log"
"os"
"os/signal"
"syscall"

"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse/nodefs"
"github.com/hanwen/go-fuse/v2/fuse/pathfs"
"github.com/lemondevxyz/aferofuse"
"github.com/spf13/afero"
)

type embeddedINode struct {
inode *fs.Inode
}

func (e *embeddedINode) EmbeddedInode() *fs.Inode {
return e.inode
}

func main() {
base := flag.String("base", "", "the base path to 'contain' the os filesystem")
debug := flag.Bool("debug", false, "print debug data")
Expand All @@ -41,5 +35,14 @@ func main() {
log.Fatalf("Mount fail: %v\n", err)
}
log.Println("Mounted!")

c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt, syscall.SIGTERM)

go func() {
<-c
server.Unmount()
}()

server.Serve()
}
14 changes: 8 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ module github.com/lemondevxyz/aferofuse
go 1.19

require (
github.com/hanwen/go-fuse v1.0.0 // indirect
github.com/hanwen/go-fuse/v2 v2.1.0 // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/spf13/afero v1.9.3 // indirect
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 // indirect
golang.org/x/text v0.3.4 // indirect
github.com/hanwen/go-fuse/v2 v2.5.1
github.com/matryer/is v1.4.1
github.com/spf13/afero v1.11.0
)

require (
golang.org/x/sys v0.20.0 // indirect
golang.org/x/text v0.15.0 // indirect
)
Loading

0 comments on commit a2a7a12

Please sign in to comment.