rules

package
v2.0.0-...-eff2c45 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchHidden

func MatchHidden(path string) bool

MatchHidden matches paths with a basename that begins with a dot.

Types

type Checker

type Checker interface {
	Check(path string) bool
}

Checker is a Rules checker.

type Regexp

type Regexp struct {
	Raw string `json:"raw"`
	// contains filtered or unexported fields
}

Regexp is a wrapper to the native regexp type where we save the raw expression.

func (*Regexp) MatchString

func (r *Regexp) MatchString(s string) bool

MatchString checks if a string matches the regexp.

type Rule

type Rule struct {
	Regex  bool    `json:"regex"`
	Allow  bool    `json:"allow"`
	Path   string  `json:"path"`
	Regexp *Regexp `json:"regexp"`
}

Rule is a allow/disallow rule.

func (*Rule) Matches

func (r *Rule) Matches(path string) bool

Matches matches a path against a rule.

Jump to

Keyboard shortcuts

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