Documentation
¶
Overview ¶
Package filter provides URL filtering based on domains and patterns.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Domains []string // Domains to ignore (includes subdomains)
GlobPatterns []string // Glob patterns (e.g., "*.local/*")
RegexPatterns []string // Regex patterns (e.g., ".*\\.internal\\..*")
}
Config holds filter configuration.
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter determines which URLs should be skipped during link checking.
func New ¶
New creates a new Filter from the given configuration. Patterns are compiled once for performance. Returns an error if any pattern fails to compile.
func (*Filter) IgnoredCount ¶
IgnoredCount returns the number of URLs that were ignored.
func (*Filter) IgnoredURLs ¶
func (f *Filter) IgnoredURLs() []IgnoreReason
IgnoredURLs returns all ignored URLs with their reasons.
func (*Filter) Reset ¶
func (f *Filter) Reset()
Reset clears the list of ignored URLs. Useful if reusing a filter for multiple checks.
func (*Filter) ShouldIgnore ¶
ShouldIgnore checks if a URL should be skipped. If the URL matches any rule, it records the reason and returns true. Check order (fastest first): domain → glob → regex.