Documentation ¶
Overview ¶
Package ignorefs implements a wrapper that hides ignored files listed in '.kopiaignore' and in policies attached to directories.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultFilesPolicy = FilesPolicy{ DotIgnoreFiles: []string{".kopiaignore"}, }
DefaultFilesPolicy is the default file ignore policy.
Functions ¶
Types ¶
type FilesPolicy ¶
type FilesPolicy struct { IgnoreRules []string `json:"ignore,omitempty"` NoParentIgnoreRules bool `json:"noParentIgnore,omitempty"` DotIgnoreFiles []string `json:"ignoreDotFiles,omitempty"` NoParentDotIgnoreFiles bool `json:"noParentDotFiles,omitempty"` MaxFileSize int64 `json:"maxFileSize,omitempty"` }
FilesPolicy describes files to be ignored when taking snapshots.
func (*FilesPolicy) Merge ¶
func (p *FilesPolicy) Merge(src FilesPolicy)
Merge applies default values from the provided policy.
type FilesPolicyGetter ¶
type FilesPolicyGetter interface {
GetPolicyForPath(relativePath string) (*FilesPolicy, error)
}
FilesPolicyGetter fetches FilesPolicy for a path relative to the root of the filesystem. relativePath always starts with "." and path elements are separated with "/".
type FilesPolicyMap ¶
type FilesPolicyMap map[string]*FilesPolicy
FilesPolicyMap implements FilesPolicyGetter for a static mapping of relative paths to FilesPolicy.
func (FilesPolicyMap) GetPolicyForPath ¶
func (m FilesPolicyMap) GetPolicyForPath(relativePath string) (*FilesPolicy, error)
GetPolicyForPath returns FilePolicy defined in the map or nil.
type IgnoreCallback ¶
IgnoreCallback is a function called by ignorefs to report whenever a file or directory is being ignored while listing its parent.
type Option ¶
type Option func(parentContext *ignoreContext)
Option modifies the behavior of ignorefs
func ReportIgnoredFiles ¶
func ReportIgnoredFiles(f IgnoreCallback) Option
ReportIgnoredFiles returns an Option causing ignorefs to call the provided function whenever a file or directory is ignored.