Documentation
¶
Overview ¶
Package selective implements include/exclude filtering rules for sync paths. Rules can be loaded from a text file (Load) or constructed from YAML config (FromYAML). Both sources share identical matching semantics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
type List struct {
Rules []Rule
IncludeAbs []string // patterns anchored to root (start with "/")
IncludeAnywhere []string // patterns matched at any depth
ExcludeAbs []string
ExcludeAnywhere []string
HasRules bool
}
List is the compiled set of include/exclude rules.
func FromYAML ¶ added in v0.7.0
FromYAML constructs a List from the include/exclude slices in a YAML config block. Matching semantics are identical to Load.
func Load ¶
Load reads a text sync-list file. An empty or missing path returns an empty list (no rules → allow everything). File format:
- Lines starting with "#" or ";" are comments.
- Lines starting with "-" or "!" are exclude rules.
- All other non-empty lines are include rules.
- A leading "/" anchors the pattern to the sync root; otherwise it matches at any depth.
Click to show internal directories.
Click to hide internal directories.