rules

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeNone   uint = 0
	TypeDNS    uint = 1
	TypeRegexp uint = 2
	TypeHost   uint = 3
)

Variables

This section is empty.

Functions

func AdblockRules added in v1.3.0

func AdblockRules(data []string, setter HostSetter)

func DNSRules added in v1.3.0

func DNSRules(data map[string]string, setter ResolveSetter) error

func HostRules added in v1.3.0

func HostRules(data map[string]string, setter HostSetter) error

func QueryRules added in v1.3.0

func QueryRules(data map[string]string, setter ResolveSetter) error

func RegexpRules added in v1.3.0

func RegexpRules(data map[string]string, setter ResolveSetter) error

Types

type Config

type Config struct {
	DumpRules    string            `yaml:"dump-rules"`
	AdblockRules []string          `yaml:"adblock-rules"`
	DNSRules     map[string]string `yaml:"dns-rules"`
	HostRules    map[string]string `yaml:"host-rules"`
	RegExpRules  map[string]string `yaml:"regexp-rules"`
	QueryRules   map[string]string `yaml:"query-rules"`
}

type HostSetter added in v1.3.0

type HostSetter interface {
	SetHostResolve(domain string, ip4, ip6 []string, ttl int64)
}

type Repository

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

func (*Repository) Down

func (v *Repository) Down() error

func (*Repository) Resolve added in v1.3.0

func (v *Repository) Resolve(q dns.Question) []dns.RR

func (*Repository) SetHostResolve added in v1.3.0

func (v *Repository) SetHostResolve(domain string, ip4, ip6 []string, ttl int64)

func (*Repository) SetRexResolve added in v1.3.0

func (v *Repository) SetRexResolve(format string, rx *regexp.Regexp, ip4, ip6 []string, tp uint)

func (*Repository) Up

func (v *Repository) Up() error

type ResolveSetter added in v1.3.0

type ResolveSetter interface {
	SetRexResolve(format string, rx *regexp.Regexp, ip4, ip6 []string, tp uint)
}

type Resolver added in v1.3.0

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

func (*Resolver) Compile added in v1.3.0

func (v *Resolver) Compile(name string) ([]string, []string, bool)

func (*Resolver) Match added in v1.3.0

func (v *Resolver) Match(name string) ([]string, []string, bool)

Jump to

Keyboard shortcuts

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