filepathfilter

package
v3.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GitIgnore     = PatternType(false)
	GitAttributes = PatternType(true)
)

Variables

This section is empty.

Functions

func DefaultValue

func DefaultValue(val bool) option

DefaultValue is an option representing the default value of a filepathfilter if no patterns match. If this option is not provided, the default is true.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

func New

func New(include, exclude []string, ptype PatternType, setters ...option) *Filter

func NewFromPatterns

func NewFromPatterns(include, exclude []Pattern, setters ...option) *Filter

func (*Filter) Allows

func (f *Filter) Allows(filename string) bool

func (*Filter) Exclude

func (f *Filter) Exclude() []string

Exclude returns the result of calling String() on each Pattern in the exclude set of this *Filter.

func (*Filter) Include

func (f *Filter) Include() []string

Include returns the result of calling String() on each Pattern in the include set of this *Filter.

type Pattern

type Pattern interface {
	Match(filename string) bool
	// String returns a string representation (see: regular expressions) of
	// the underlying pattern used to match filenames against this Pattern.
	String() string
}

func NewPattern

func NewPattern(p string, ptype PatternType) Pattern

type PatternType

type PatternType bool

func (PatternType) String

func (p PatternType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL