filter

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlwasyExp added in v1.0.0

type AlwasyExp bool

func (AlwasyExp) Match added in v1.0.0

func (a AlwasyExp) Match(path string, info fs.DirEntry) (bool, error)

func (AlwasyExp) String added in v1.0.0

func (a AlwasyExp) String() string

type AndExp

type AndExp []FileExp

func (AndExp) Match

func (e AndExp) Match(path string, info fs.DirEntry) (bool, error)

func (AndExp) String

func (e AndExp) String() string

type CmpOption

type CmpOption int
const (
	EqualCmpOption CmpOption = iota
	GreaterCmpOption
	LessCmpOption
)

type Executable

type Executable struct{}

func NewExecutable

func NewExecutable() *Executable

func (*Executable) Match

func (*Executable) Match(_ string, info fs.DirEntry) (bool, error)

func (*Executable) String

func (*Executable) String() string

type FileExp

type FileExp interface {
	Match(path string, info fs.DirEntry) (bool, error)
}

type FileName

type FileName struct{ *glob.Glob }

func NewFileName

func NewFileName(pattern string) (*FileName, error)

func (FileName) Match

func (f FileName) Match(_ string, info fs.DirEntry) (bool, error)

func (FileName) String

func (f FileName) String() string

type FileType

type FileType fs.FileMode

func NewFileType

func NewFileType(typ string) (FileType, error)

func (FileType) Match

func (f FileType) Match(_ string, info fs.DirEntry) (bool, error)

func (FileType) String

func (f FileType) String() string

type Gitignore

type Gitignore struct {
	PathMatchers []gitignore.Pattern
}

func NewGitIgnore

func NewGitIgnore(rootDir string, filePath string) (*Gitignore, error)

func (*Gitignore) Add

func (g *Gitignore) Add(src *Gitignore) *Gitignore

func (*Gitignore) Match

func (g *Gitignore) Match(path string, info fs.DirEntry) (bool, error)

type IFileName

type IFileName struct{ *glob.Glob }

func NewIFileName

func NewIFileName(pattern string) (*IFileName, error)

func (IFileName) Match

func (f IFileName) Match(_ string, info fs.DirEntry) (bool, error)

func (IFileName) String

func (f IFileName) String() string

type IPath

type IPath struct{ *glob.Glob }

func NewIPath

func NewIPath(pattern string) (*IPath, error)

func (IPath) Match

func (p IPath) Match(path string, _ fs.DirEntry) (bool, error)

func (IPath) String

func (p IPath) String() string

type NotExp

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

func NewNotExp

func NewNotExp(f FileExp) *NotExp

func (*NotExp) Match

func (n *NotExp) Match(path string, info fs.DirEntry) (bool, error)

func (*NotExp) String

func (e *NotExp) String() string

type OrExp

type OrExp []FileExp

func NewOrExp

func NewOrExp(f FileExp) OrExp

func (OrExp) Match

func (e OrExp) Match(path string, info fs.DirEntry) (bool, error)

func (OrExp) String

func (e OrExp) String() string

type Path

type Path struct{ *glob.Glob }

func NewPath

func NewPath(pattern string) (*Path, error)

func (Path) Match

func (p Path) Match(path string, _ fs.DirEntry) (bool, error)

func (Path) String

func (p Path) String() string

type Regex

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

func NewIRegex

func NewIRegex(pattern string) (*Regex, error)

func NewRegex

func NewRegex(pattern string) (*Regex, error)

func (*Regex) Match

func (r *Regex) Match(path string, _ fs.DirEntry) (bool, error)

func (*Regex) String

func (r *Regex) String() string

type RegexName

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

func NewIRegexName

func NewIRegexName(pattern string) (*RegexName, error)

func NewRegexName

func NewRegexName(pattern string) (*RegexName, error)

func (*RegexName) Match

func (r *RegexName) Match(_ string, info fs.DirEntry) (bool, error)

func (*RegexName) String

func (r *RegexName) String() string

type Size

type Size struct {
	Size int64
	Opt  CmpOption
}

func NewSize

func NewSize(str string) (*Size, error)

func (*Size) Match

func (s *Size) Match(_ string, entry fs.DirEntry) (bool, error)

Jump to

Keyboard shortcuts

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