localfs

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

Package localfs implements virtual filesystem abstraction for a local filesystem.

Index

Constants

View Source
const (
	// ShallowEntrySuffix is a suffix identifying placeholder files.
	ShallowEntrySuffix = ".kopia-entry"
)

Variables

This section is empty.

Functions

func Directory

func Directory(path string) (fs.Directory, error)

Directory returns fs.Directory for the specified path.

func NewEntry

func NewEntry(path string) (fs.Entry, error)

NewEntry returns fs.Entry for the specified path, the result will be one of supported entry types: fs.File, fs.Directory, fs.Symlink or fs.UnsupportedEntry.

func TrimShallowSuffix added in v0.9.0

func TrimShallowSuffix(path string) string

TrimShallowSuffix returns the path without the placeholder suffix.

func WriteShallowPlaceholder added in v0.9.0

func WriteShallowPlaceholder(path string, de *snapshot.DirEntry) (string, error)

WriteShallowPlaceholder writes sufficient metadata into the placeholder file associated with path so that it can be roundtripped through snapshot/restore without needing to be realized in the local filesystem. TODO(rjk): Should the placeholder use the complete fs.Entry?

Types

type PlaceholderFilePath added in v0.9.0

type PlaceholderFilePath string

PlaceholderFilePath is a filesystem path of a shallow placeholder file or directory.

func (PlaceholderFilePath) DirEntryOrNil added in v0.9.0

func (pf PlaceholderFilePath) DirEntryOrNil(ctx context.Context) (*snapshot.DirEntry, error)

DirEntryOrNil returns the snapshot.DirEntry corresponding to this PlaceholderFilePath.

Jump to

Keyboard shortcuts

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