ignore

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GlobMatch

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

GlobMatch handle glob matching.

func NewBaseGlobMatch

func NewBaseGlobMatch(arg string, truth bool) (*GlobMatch, error)

NewBaseGlobMatch compiles a new matcher. Arg true should be set to false if the output is inverted.

func NewGlobMatch

func NewGlobMatch(arg []byte) (*GlobMatch, error)

NewGlobMatch creates a new GlobMatch instance or error.

func NewPathGlobMatch

func NewPathGlobMatch(arg string, truth bool) (*GlobMatch, error)

NewPathGlobMatch compiles a new matcher. Arg true should be set to false if the output is inverted.

func (*GlobMatch) MarshalText

func (g *GlobMatch) MarshalText() ([]byte, error)

MarshalText is really a debug function.

func (*GlobMatch) Match

func (g *GlobMatch) Match(file string) bool

Match satisfies the Matcher interface.

func (*GlobMatch) True

func (g *GlobMatch) True() bool

True returns true if this should be evaluated normally ("true is true") and false if the result should be inverted ("false is true").

type Matcher

type Matcher interface {
	Match(arg string) bool
	True() bool
	MarshalText() ([]byte, error)
}

Matcher defines an interface for filematchers.

type MultiMatch

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

MultiMatch has matching on a list of matchers.

func NewMultiMatch

func NewMultiMatch(matchers []Matcher) *MultiMatch

NewMultiMatch creates a new MultiMatch instance.

func Parse

func Parse(src []byte) (*MultiMatch, error)

Parse reads in a gitignore file and returns a Matcher.

func (*MultiMatch) MarshalText

func (mm *MultiMatch) MarshalText() ([]byte, error)

MarshalText satisfies the ?? interface.

func (*MultiMatch) Match

func (mm *MultiMatch) Match(arg string) bool

Match satisfies the Matcher interface.

func (*MultiMatch) True

func (mm *MultiMatch) True() bool

True returns true.

Jump to

Keyboard shortcuts

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