rule

package
v0.6.29 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsComplex added in v0.3.15

func IsComplex(ruleText string) bool

func ParseLine added in v0.3.15

func ParseLine(line string) string

parse a line, as from a file, and return the part that represents the rule

Types

type ComplexRule added in v0.3.15

type ComplexRule interface {
	IsMatch(sample string) bool
	Text() string
}

type Match

type Match uint8

a match can be: allow (don't block, override/bypass block) block (explicit block) none (no reason found to block or allow)

const (
	MatchAllow Match = 2
	MatchBlock Match = 1
	MatchNone  Match = 0
)

type Store added in v0.6.11

type Store interface {
	Init(sessionRoot string, config *config.GudgeonConfig, lists []*config.GudgeonList)

	Load(list *config.GudgeonList, rule string)

	Clear(config *config.GudgeonConfig, list *config.GudgeonList)

	Finalize(sessionRoot string, lists []*config.GudgeonList)

	FindMatch(lists []*config.GudgeonList, domain string) (Match, *config.GudgeonList, string)

	Close()
}

func CreateStore

func CreateStore(storeRoot string, conf *config.GudgeonConfig) (Store, []uint64)

stores are created from lists of files inside a configuration

Jump to

Keyboard shortcuts

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