Commit 91a3fbea authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/pathfs: Return FileSystem in NewLoopbackFileSystem.

parent 3d9d5c3f
...@@ -16,23 +16,26 @@ var _ = fmt.Println ...@@ -16,23 +16,26 @@ var _ = fmt.Println
var _ = log.Println var _ = log.Println
type loopbackFileSystem struct { type loopbackFileSystem struct {
Root string // TODO - this should need default fill in.
FileSystem FileSystem
Root string
} }
// A FUSE filesystem that shunts all request to an underlying file // A FUSE filesystem that shunts all request to an underlying file
// system. Its main purpose is to provide test coverage without // system. Its main purpose is to provide test coverage without
// having to build a synthetic filesystem. // having to build a synthetic filesystem.
func NewLoopbackFileSystem(root string) (out *loopbackFileSystem) { func NewLoopbackFileSystem(root string) FileSystem {
out = &loopbackFileSystem{ return &loopbackFileSystem{
FileSystem: NewDefaultFileSystem(), FileSystem: NewDefaultFileSystem(),
Root: root, Root: root,
} }
}
return out func (fs *loopbackFileSystem) OnMount(nodeFs *PathNodeFs) {
} }
func (fs *loopbackFileSystem) OnUnmount() {}
func (fs *loopbackFileSystem) GetPath(relPath string) string { func (fs *loopbackFileSystem) GetPath(relPath string) string {
return filepath.Join(fs.Root, relPath) return filepath.Join(fs.Root, relPath)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment