ruleset

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Direct             = 0
	IPIfNonDomainMatch = 1
	OnlyDomainMatch    = 2
	OnlyIPMatch        = 3
)

Functions

func ResetCache

func ResetCache()

Types

type Ruleset

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

func Parse

func Parse(name, dataRoot string, ruleset []string,
	dial func(ctx context.Context, network, addr string) (net.Conn, error)) (rs *Ruleset, err error)

func (*Ruleset) CountryMatch

func (rs *Ruleset) CountryMatch(country string) bool

func (*Ruleset) DirectMatch

func (rs *Ruleset) DirectMatch(host string) bool

func (*Ruleset) IfIPCountryMatch

func (rs *Ruleset) IfIPCountryMatch(country string) bool

func (*Ruleset) LoadFromReader

func (rs *Ruleset) LoadFromReader(reader bufio.Reader) error

func (*Ruleset) MatchStrategy

func (rs *Ruleset) MatchStrategy() int

func (*Ruleset) PrintStats

func (rs *Ruleset) PrintStats()

func (*Ruleset) Reload added in v0.10.3

func (rs *Ruleset) Reload() (err error)

func (*Ruleset) SpecialMatch

func (rs *Ruleset) SpecialMatch(host string) bool

func (*Ruleset) WildcardMatch

func (rs *Ruleset) WildcardMatch(host string) bool

Jump to

Keyboard shortcuts

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