summaryrefslogtreecommitdiff
path: root/frontend/fs.go
blob: 637d134d5fa1980b973e47fafb66a62b644c0ada (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package frontend

import (
	"github.com/rfjakob/gocryptfs/cryptfs"
	"bazil.org/fuse/fs"
)

type FS struct {
	*cryptfs.FS
	backing string
}

func New(key [16]byte, b string) *FS {
	return &FS {
		FS: cryptfs.NewFS(key),
		backing: b,
	}
}

func (fs *FS) Root() (fs.Node, error) {
	n := Node{
		backing: "",
		parentFS: fs,
	}
	return n, nil
}