fuse

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: BSD-2-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	OwnerIsRoot   bool
	Filter        restic.SnapshotFilter
	TimeTemplate  string
	PathTemplates []string
}

Config holds settings for the fuse mount.

type MetaDirData

type MetaDirData struct {
	// contains filtered or unexported fields
}

type Root

type Root struct {
	*SnapshotsDir
	// contains filtered or unexported fields
}

Root is the root node of the fuse mount of a repository.

func NewRoot

func NewRoot(repo restic.Repository, cfg Config) *Root

NewRoot initializes a new root node from a repository.

func (*Root) Root

func (r *Root) Root() (fs.Node, error)

Root is just there to satisfy fs.Root, it returns itself.

type SnapshotsDir

type SnapshotsDir struct {
	// contains filtered or unexported fields
}

SnapshotsDir is a actual fuse directory generated from SnapshotsDirStructure It uses the saved prefix to select the corresponding MetaDirData.

func NewSnapshotsDir

func NewSnapshotsDir(root *Root, inode, parentInode uint64, dirStruct *SnapshotsDirStructure, prefix string) *SnapshotsDir

NewSnapshotsDir returns a new directory structure containing snapshots and "latest" links

func (*SnapshotsDir) Attr

func (d *SnapshotsDir) Attr(_ context.Context, attr *fuse.Attr) error

Attr returns the attributes for any dir in the snapshots directory structure

func (*SnapshotsDir) Lookup

func (d *SnapshotsDir) Lookup(ctx context.Context, name string) (fs.Node, error)

Lookup returns a specific entry from the SnapshotsDir.

func (*SnapshotsDir) ReadDirAll

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

ReadDirAll returns all entries of the SnapshotsDir.

type SnapshotsDirStructure

type SnapshotsDirStructure struct {
	// contains filtered or unexported fields
}

SnapshotsDirStructure contains the directory structure for snapshots. It uses a paths and time template to generate a map of pathnames pointing to the actual snapshots. For templates that end with a time, also "latest" links are generated.

func NewSnapshotsDirStructure

func NewSnapshotsDirStructure(root *Root, pathTemplates []string, timeTemplate string) *SnapshotsDirStructure

NewSnapshotsDirStructure returns a new directory structure for snapshots.

func (*SnapshotsDirStructure) UpdatePrefix

func (d *SnapshotsDirStructure) UpdatePrefix(ctx context.Context, prefix string) (*MetaDirData, error)

Jump to

Keyboard shortcuts

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