rule

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Rule

type Rule struct {
	// Mode is a behaviour backed by a function from the `mode` package
	Mode string `yaml:"mode"`
	// Prefix is a literal path prefix to be matched against the passed file path
	Prefix string `yaml:"prefix"`
	// NameEx is a regex to be matched against the passed file base name
	NameEx string `yaml:"name"`
	// Negate reverses the rule match effect
	Negate bool `yaml:"negate"`

	// ModeFn is an `mode` package function to invoke on passed file / dir entry
	ModeFn func(os.DirEntry) bool
}

Rule is a single configuration rule entity (a list of rules is contained by a config.Config)

func (Rule) Admit

func (r Rule) Admit(d os.DirEntry, relPath string) bool

Admit is a local "decider" function that includes/excludes the path given [on the single rule level]

Jump to

Keyboard shortcuts

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