Documentation ¶
Index ¶
- func WriteIgnores(filesystem fs.Filesystem, path string, content []string) error
- type ChangeDetector
- type Matcher
- func (m *Matcher) Hash() string
- func (m *Matcher) Lines() []string
- func (m *Matcher) Load(file string) error
- func (m *Matcher) Match(file string) (result Result)
- func (m *Matcher) Parse(r io.Reader, file string) error
- func (m *Matcher) Patterns() []string
- func (m *Matcher) ShouldIgnore(filename string) bool
- func (m *Matcher) Stop()
- func (m *Matcher) String() string
- type Option
- type Pattern
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteIgnores ¶ added in v0.14.28
func WriteIgnores(filesystem fs.Filesystem, path string, content []string) error
WriteIgnores is a convenience function to avoid code duplication
Types ¶
type ChangeDetector ¶ added in v0.14.31
type ChangeDetector interface { Remember(fs fs.Filesystem, name string, modtime time.Time) Seen(fs fs.Filesystem, name string) bool Changed() bool Reset() }
The ChangeDetector is responsible for determining if files have changed on disk. It gets told to Remember() files (name and modtime) and will then get asked if a file has been Seen() (i.e., Remember() has been called on it) and if any of the files have Changed(). To forget all files, call Reset().
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
func (*Matcher) Lines ¶ added in v0.14.28
Lines return a list of the unprocessed lines in .stignore at last load
func (*Matcher) ShouldIgnore ¶ added in v0.14.20
ShouldIgnore returns true when a file is temporary, internal or ignored
type Option ¶ added in v0.14.31
type Option func(*Matcher)
An Option can be passed to New()
func WithCache ¶ added in v0.14.31
WithCache enables or disables lookup caching. The default is disabled.
func WithChangeDetector ¶ added in v0.14.31
func WithChangeDetector(cd ChangeDetector) Option
WithChangeDetector sets a custom ChangeDetector. The default is to simply use the on disk modtime for comparison.