fs

package
v0.0.0-...-eaebda1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SourceType string

Functions

func NewFS

func NewFS(w io.Writer, mountpoint string)

Types

type Dir

type Dir struct {
	Node
	Entries map[string]Entity
}

func NewDir

func NewDir(parent *Dir, name string, uri string, wfs *WFS, size uint64, mtime time.Time) *Dir

func (*Dir) Config

func (d *Dir) Config() []byte

func (*Dir) GetDepth

func (d *Dir) GetDepth() uint32

func (*Dir) GetNode

func (d *Dir) GetNode() *Node

func (*Dir) GetPrefix

func (d *Dir) GetPrefix(depth ...int) string

func (*Dir) GetSourceRoot

func (d *Dir) GetSourceRoot() string

func (*Dir) List

func (d *Dir) List()

func (*Dir) Lookup

func (d *Dir) Lookup(ctx context.Context, req *fuse.LookupRequest, resp *fuse.LookupResponse) (fs.Node, error)

func (*Dir) ReadDirAll

func (d *Dir) ReadDirAll(ctx context.Context) ([]fuse.Dirent, error)

func (*Dir) Search

func (d *Dir) Search(query string)

type Entity

type Entity interface {
	IsDir() bool
	Path() string
	GetNode() *Node
}

type File

type File struct {
	Node
	Data []byte
}

func NewFile

func NewFile(parent *Dir, name string, wfs *WFS, size uint64, mtime time.Time) *File

func (*File) Download

func (f *File) Download(ctx context.Context) []byte

func (*File) GetNode

func (f *File) GetNode() *Node

func (*File) GetSourceRoot

func (f *File) GetSourceRoot() string

func (*File) Read

func (f *File) Read(ctx context.Context, req *fuse.ReadRequest, resp *fuse.ReadResponse) error

type Node

type Node struct {
	ID         uint64
	FuseType   fuse.DirentType
	Name       string
	Size       uint64
	Mtime      time.Time
	Attrs      fuse.Attr
	Parent     *Dir
	Uri        string
	Loaded     bool
	SourceType string
	WFS        *WFS
}

func (*Node) Attr

func (n *Node) Attr(ctx context.Context, attr *fuse.Attr) error

func (*Node) GetNode

func (n *Node) GetNode() *Node

func (*Node) GetParent

func (n *Node) GetParent() *Dir

func (*Node) IsDir

func (n *Node) IsDir() bool

func (*Node) Path

func (n *Node) Path() string

func (*Node) String

func (n *Node) String() string

type WFS

type WFS struct {
	MountPoint string
	RootDir    *Dir
	NodeID     uint64
	Configs    map[string][]byte
	VM         *otto.Otto
}

func (*WFS) NextID

func (wfs *WFS) NextID() uint64

func (WFS) Root

func (wfs WFS) Root() (fs.Node, error)

func (WFS) Shutdown

func (wfs WFS) Shutdown() error

func (*WFS) Statfs

func (wfs *WFS) Statfs(ctx context.Context, req *fuse.StatfsRequest, resp *fuse.StatfsResponse) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL