first servicable server
This commit is contained in:
parent
90aa93a1d7
commit
869999fc3e
8 changed files with 309 additions and 12 deletions
18
fuse.go
18
fuse.go
|
|
@ -1,5 +1,21 @@
|
|||
package kubelwagen
|
||||
|
||||
func serveFuse(dir string, closer chan bool) error {
|
||||
import (
|
||||
"github.com/hanwen/go-fuse/fuse/nodefs"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func serveFuse(dir string, req chan RequestCallback, closer chan bool) error {
|
||||
opts := WsFsOpts{
|
||||
ReadOnly: true,
|
||||
}
|
||||
nfs := NewWsFs(opts, req, closer)
|
||||
server, _, err := nodefs.MountRoot(dir, nfs.Root(), nil)
|
||||
if err != nil {
|
||||
logrus.Fatalln("cannot mount:", err)
|
||||
}
|
||||
defer server.Unmount()
|
||||
go server.Serve()
|
||||
<-closer
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue