local

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*localOptions)

Option configures a local filesystem source.

func WithExcludePatterns

func WithExcludePatterns(patterns []string) Option

WithExcludePatterns sets the patterns used to exclude files and folders.

func WithSkipFlags

func WithSkipFlags() Option

WithSkipFlags disables file flags collection.

func WithSkipMode

func WithSkipMode() Option

WithSkipMode disables collection of POSIX mode, uid, gid, btime, and flags.

func WithSkipXattrs

func WithSkipXattrs() Option

WithSkipXattrs disables extended attribute collection.

func WithVolumeUUID

func WithVolumeUUID(uuid string) Option

WithVolumeUUID overrides the auto-detected volume UUID for the source. Use this for filesystems where UUID detection is unsupported or to explicitly tie backups to a specific snapshot lineage.

func WithXattrNamespaces

func WithXattrNamespaces(prefixes []string) Option

WithXattrNamespaces restricts xattr collection to attributes whose name starts with one of the given prefixes (e.g. "user.", "com.apple."). An empty slice (default) collects all readable attributes.

type Source

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

Source implements Source for local filesystem.

func New

func New(rootPath string, opts ...Option) *Source

New creates a local filesystem source rooted at rootPath.

func (*Source) GetFileStream

func (s *Source) GetFileStream(fileID string) (io.ReadCloser, error)

func (*Source) Info

func (s *Source) Info() source.SourceInfo

func (*Source) Size

func (s *Source) Size(ctx context.Context) (*source.SourceSize, error)

func (*Source) VolumeLabel

func (s *Source) VolumeLabel() string

VolumeLabel returns the detected volume label. Exported for testing.

func (*Source) VolumeUUID

func (s *Source) VolumeUUID() string

VolumeUUID returns the detected or overridden volume UUID. Exported for testing.

func (*Source) Walk

func (s *Source) Walk(ctx context.Context, callback func(source.FileMeta) error) error

Jump to

Keyboard shortcuts

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