feature: Implements basic key generation.

This commit is contained in:
imterah 2024-11-22 07:25:17 -05:00
parent 768e17f840
commit a317342aa6
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
6 changed files with 308 additions and 2 deletions

33
bofs/fs.go Normal file
View file

@ -0,0 +1,33 @@
package bofs
import (
"context"
"syscall"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
)
type BoronInode struct {
fs.Inode
}
func (r *BoronInode) OnAdd(ctx context.Context) {
ch := r.NewPersistentInode(
ctx, &fs.MemRegularFile{
Data: []byte("file.txt"),
Attr: fuse.Attr{
Mode: 0644,
},
}, fs.StableAttr{Ino: 2})
r.AddChild("file.txt", ch, false)
}
func (r *BoronInode) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno {
out.Mode = 0755
return 0
}
var _ = (fs.NodeGetattrer)((*BoronInode)(nil))
var _ = (fs.NodeOnAdder)((*BoronInode)(nil))