Documentation
¶
Overview ¶
Package importlib implements common plumbing for copying file trees from a local filesystem into FFS representation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Verbose bool // emit diagnostic output
IncludeXAttr bool // capture extended attributes
OmitStat bool // do not capture stat metadata
FilterName string // name of filter file to read
// A filesystem implementation to read from, or nil.
// If it is nil, the config uses the standard library's [os] package.
// It may optionally also implement [fs.ReadLinkFS] if symlinks are supported.
// It may optionally also implement [XAttrFS] if extended attributes are supported.
FS fs.ReadDirFS
}
Config carries settings for storing files into an FFS store.
func (Config) ImportPath ¶
ImportPath imports a single file, directory, or symlink into the store. If path names a directory, its contents are imported recursively.
func (Config) ImportTar ¶
ImportTar imports the complete contents of tr into a new file tree in s, and returns the root of that tree. On success, the resulting root is flushed to storage, so its [File.Key] method will report the storage key.
type Filter ¶
Filter is a collection of path filters used to control what parts of a file tree get copied by "put" operations. Each line of a filter file specifies a glob matching file paths. By default, all files are included, and any path matching a rule is filtered out.
Each directory may specify its own filter, which governs paths under that directory. If a rule is prefixed with "!", a match of that rule overrides an exclusion, either from the directory itself or a parent filters.
type Rule ¶
type Rule struct {
*regexp.Regexp // the compiled glob expression
Negate bool // if true, override a previous exclusion
}
A Rule is a single filter rule.
type XAttrFS ¶
type XAttrFS interface {
fs.FS
// ListXAttr reports the names of all the extended attributes on path.
ListXAttr(path string) ([]string, error)
// GetXAttr returns the complete contents of the specified extended
// attribute on path. If no such attribute exists, it must return an error
// matching [fs.ErrNotExist].
GetXAttr(path, name string) ([]byte, error)
}
XAttrFS is an optional extension interface for fs.FS that includes support for reading extended attributes.