Documentation
¶
Overview ¶
Package secretpath matches a filesystem path against a configured list of glob-style secret path patterns, so a caller can decide whether a path holds sensitive content before it reads, writes, or logs it. Matches is a pure string decision; it never touches the filesystem.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher holds a compiled, ordered list of secret path patterns.
func NewMatcher ¶
NewMatcher compiles patterns into a Matcher. patterns follow path.Match glob syntax, plus a trailing '/' to match a directory and everything under it, and a leading '!' to negate a later match. An invalid glob returns an error naming the pattern's index.
func (*Matcher) Matches ¶
Matches reports whether path matches the compiled pattern set. It cleans the input with path.Clean and treats '\' the same as '/' first. Patterns apply in list order; the last matching pattern, positive or negated, decides the result. A nil *Matcher holds no pattern, so it matches nothing and returns false.