photofs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mount

func Mount(ctx context.Context, mountPoint string, db db.DB, queries []types.NamedQuery) (*fuse.Server, error)

func NewDirINode

func NewDirINode(ctx context.Context, n DirNode) (fs.InodeEmbedder, error)

func NewRoot

func NewRoot(ctx context.Context, db db.DB, queries []types.NamedQuery) (fs.InodeEmbedder, error)

Types

type DirINode

type DirINode struct {
	fs.Inode
	// contains filtered or unexported fields
}

func (*DirINode) Lookup

func (n *DirINode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*DirINode) Readdir

func (n *DirINode) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)

type DirNode

type DirNode interface {
	Children(context.Context) (map[string]Node, error)
}

DirNode is our interface for a directory.

Note that DirNode is not a Node because we only need to be a node for children of DirNode, but at the very top level our root node is not a child of any other DirNode but rather just mounted directly into the existing file system.

type Node

type Node interface {
	Name() string
	Mode() uint32
	INode(context.Context) (fs.InodeEmbedder, error)
}

Node is our interface for a file/directory within our virtual file system. Note that Node is NOT an INode but can rather get an INode, this is to make it so we can represent children of a directory without needing to actually create their INodes yet.

Jump to

Keyboard shortcuts

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