feature: Implements basic key generation.
This commit is contained in:
parent
768e17f840
commit
a317342aa6
6 changed files with 308 additions and 2 deletions
33
bofs/fs.go
Normal file
33
bofs/fs.go
Normal 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))
|
Loading…
Add table
Add a link
Reference in a new issue