diff options
Diffstat (limited to 'frontend/fs.go')
-rw-r--r-- | frontend/fs.go | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/frontend/fs.go b/frontend/fs.go index 637d134..ba6ad09 100644 --- a/frontend/fs.go +++ b/frontend/fs.go @@ -2,25 +2,26 @@ package frontend import ( "github.com/rfjakob/gocryptfs/cryptfs" - "bazil.org/fuse/fs" + "github.com/rfjakob/cluefs/lib/cluefs" ) type FS struct { - *cryptfs.FS - backing string + *cryptfs.CryptFS + *cluefs.ClueFS } -func New(key [16]byte, b string) *FS { - return &FS { - FS: cryptfs.NewFS(key), - backing: b, - } -} +type nullTracer struct {} -func (fs *FS) Root() (fs.Node, error) { - n := Node{ - backing: "", - parentFS: fs, +func (nullTracer) Trace(op cluefs.FsOperTracer) {} + +func NewFS(key [16]byte, backing string) *FS { + var nt nullTracer + clfs, err := cluefs.NewClueFS(backing, nt) + if err != nil { + panic(err) + } + return &FS { + CryptFS: cryptfs.NewCryptFS(key), + ClueFS: clfs, } - return n, nil } |