domainmatcher

package
v0.0.0-...-967fbc8 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

func NewLoader

func NewLoader() *Loader

func (*Loader) Add

func (l *Loader) Add(rule []byte) error

Add adds rule to the matcher. Rule format: <typ:><exp> <typ> can be domain | full | regexp Default type is domain if <typ> is omitted. <exp> is a domain name, escaping is not supported. For regexp, <exp> is a regular expression for Non-fqdn, lower-case domains.

E.g. "google.com", "regexp:google.com$"

func (*Loader) Compile

func (l *Loader) Compile() (*Matcher, error)

func (*Loader) LoadRulesFromReader

func (l *Loader) LoadRulesFromReader(r io.Reader) error

type Matcher

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

func Deserialize

func Deserialize(r io.Reader) (*Matcher, error)

func (*Matcher) Len

func (m *Matcher) Len() int

func (*Matcher) Match

func (m *Matcher) Match(name dnsmsg.Name) bool

func (*Matcher) Serialize

func (m *Matcher) Serialize(w io.Writer) (err error)

Jump to

Keyboard shortcuts

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