libgocryptfs/frontend/fs.go

27 lines
342 B
Go
Raw Normal View History

2015-09-03 19:09:23 +02:00
package frontend
import (
"github.com/rfjakob/gocryptfs/cryptfs"
2015-09-03 19:27:07 +02:00
"bazil.org/fuse/fs"
2015-09-03 19:09:23 +02:00
)
type FS struct {
2015-09-03 19:27:07 +02:00
*cryptfs.FS
2015-09-03 23:54:12 +02:00
backing string
2015-09-03 19:27:07 +02:00
}
2015-09-03 23:54:12 +02:00
func New(key [16]byte, b string) *FS {
2015-09-03 19:27:07 +02:00
return &FS {
FS: cryptfs.NewFS(key),
2015-09-03 23:54:12 +02:00
backing: b,
2015-09-03 19:27:07 +02:00
}
}
func (fs *FS) Root() (fs.Node, error) {
2015-09-03 23:54:12 +02:00
n := Node{
backing: "",
parentFS: fs,
}
return n, nil
2015-09-03 19:09:23 +02:00
}