Documentation
¶
Overview ¶
Package filter provides filtering functionality for modules based on glob patterns and segment values. The public API surface is intentionally tiny:
- Options describes which filters to apply
- Apply runs the filters against a module slice
- Flags collects filter values from CLI flags
- ParseSegmentFilters parses --filter key=value strings
Concrete filter types (glob, segment, composite) are package-internal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply applies all configured filters to modules. Returns the input slice unchanged when no filter criteria are set.
func ParseSegmentFilters ¶
ParseSegmentFilters parses "key=value" strings into a segment filter map.
Types ¶
type Flags ¶ added in v0.7.3
Flags holds parsed filter values from CLI flags. Source-agnostic — works with any CLI framework (cobra, etc.). Both core commands and feature extensions use this to collect filter inputs.
type Matcher ¶ added in v0.10.0
type Matcher struct {
// contains filtered or unexported fields
}
Matcher is a precompiled filter predicate. Build one with Options.Compile() to amortize filter construction across many module checks — callers that invoke Apply on slice-of-1 inside a loop can hoist Compile() out and reuse the Matcher in the inner loop.