filters

package
v0.0.0-...-6432134 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exclude

type Exclude struct {
	Glob Glob
}

Exclude files that match Glob.

func (Exclude) MarshalText

func (e Exclude) MarshalText() ([]byte, error)

MarshalText converts the filter into a string.

type Filter

type Filter interface {
	encoding.TextMarshaler
	// contains filtered or unexported methods
}

Filter narrows what files are chosen.

type Filters

type Filters []Filter

Filters is a slice of items implementing the Filter interface. It adds support for JSON unmarshaling and evaluating filters.

func (Filters) Match

func (fs Filters) Match(base string) bool

Match finds the first matching filter and returns its Kind, or Include if no filter matched.

func (*Filters) UnmarshalJSON

func (fs *Filters) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON data into the concrete types implementing the Filter interface.

type Glob

type Glob string

Glob is a pattern that can be used to match inputs. See path.Match for the syntax.

func (*Glob) MarshalText

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

MarshalText converts the glob into a string.

func (*Glob) Match

func (g *Glob) Match(name string) bool

Match reports whether name matches the pattern.

func (*Glob) UnmarshalText

func (g *Glob) UnmarshalText(data []byte) error

UnmarshalText converts a string into a glob, checking it for syntax errors.

type Include

type Include struct {
	Glob Glob
}

Include files that match Glob.

func (Include) MarshalText

func (i Include) MarshalText() ([]byte, error)

MarshalText converts the filter into a string.

Jump to

Keyboard shortcuts

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