slim

package
v0.0.0-...-f6a3884 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LoopbackNode

type LoopbackNode struct {
	fs.LoopbackNode
}

func (*LoopbackNode) Create

func (n *LoopbackNode) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (*fs.Inode, fs.FileHandle, uint32, syscall.Errno)

func (*LoopbackNode) Flush

Flush is called for the close(2) call, could be multiple times. See: https://github.com/hanwen/go-fuse/blob/aff07cbd88fef6a2561a87a1e43255516ba7d4b6/fs/api.go#L369

func (*LoopbackNode) Lookup

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

Lookup is the event when a path is being looked for. When it is found, then we see open.

func (*LoopbackNode) Open

func (n *LoopbackNode) Readlink(ctx context.Context) ([]byte, syscall.Errno)

type SlimFS

type SlimFS struct {
	Server *fuse.Server
	// Mountpoint has /root and /cache under it
	MountPoint string

	// Output file, if defined, to save events
	Outfile string
}

func NewSlimFS

func NewSlimFS(
	mountPath string,
	recordFile string,
	readOnly bool,
) (*SlimFS, error)

NewSlimFS returns a new wrapper to a fuse.Server We mount a fusefs to a temporary directory The server returned (if not nil) needs to be correctly handled - see how it is used here in the library If recorder is true, we instantiate a recording base

func (*SlimFS) CacheFS

func (sfs *SlimFS) CacheFS() string

CacheFS returns the path in the cache under the mountpoint

func (*SlimFS) Cleanup

func (sfs *SlimFS) Cleanup(keepCache bool)

Cleanup removes the mountpoint directory

func (*SlimFS) InitLoopbackRoot

func (sfs *SlimFS) InitLoopbackRoot(
	rootPath string,
	updates chan Update,
	readOnly bool,
) error

InitLoopbackRoot creates a fuse.Server

func (*SlimFS) MountedPath

func (sfs *SlimFS) MountedPath(path string) string

MountedPath returns the path in the context of the fuse mount.

func (*SlimFS) RootFS

func (sfs *SlimFS) RootFS() string

RootFS returns the path in the root under the mountpoint

func (*SlimFS) RunCommand

func (sfs *SlimFS) RunCommand(command, workdir string) error

RunComand to the fuse filesystem

type Update

type Update struct {
	Message string
}

Generic update type to be parsed later

Jump to

Keyboard shortcuts

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