domain

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainMatcher added in v0.18.0

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

func NewDomainMatcher added in v0.19.1

func NewDomainMatcher(mode MatchMode) *DomainMatcher

func (*DomainMatcher) Add added in v0.18.0

func (m *DomainMatcher) Add(domain string, v interface{})

func (*DomainMatcher) Len added in v0.18.0

func (m *DomainMatcher) Len() int

func (*DomainMatcher) Match added in v0.18.0

func (m *DomainMatcher) Match(fqdn string) (v interface{}, ok bool)

type KeywordMatcher added in v0.19.1

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

func NewKeywordMatcher added in v0.19.1

func NewKeywordMatcher() *KeywordMatcher

func (*KeywordMatcher) Add added in v0.19.1

func (m *KeywordMatcher) Add(keyword string, v interface{})

func (*KeywordMatcher) Match added in v0.19.1

func (m *KeywordMatcher) Match(fqdn string) (v interface{}, ok bool)

type MatchMode added in v0.19.1

type MatchMode uint8
const (
	MatchModeDomain MatchMode = iota
	MatchModeFull
)

type Matcher

type Matcher interface {
	Match(fqdn string) (v interface{}, ok bool)
}

func NewV2MatcherFromFile

func NewV2MatcherFromFile(file, countryCode string) (Matcher, error)

type MatcherGroup

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

func NewMatcherGroup

func NewMatcherGroup(m []Matcher) *MatcherGroup

func (*MatcherGroup) Match

func (mg *MatcherGroup) Match(fqdn string) (v interface{}, ok bool)

type MixMatcher added in v0.19.1

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

func NewMixMatcher added in v0.19.1

func NewMixMatcher() *MixMatcher

func (*MixMatcher) AddElem added in v0.19.1

func (m *MixMatcher) AddElem(typ router.Domain_Type, s string, v interface{}) error

func (*MixMatcher) LoadFormDAT added in v0.21.0

func (m *MixMatcher) LoadFormDAT(file, countryCode string, attr []string) error

func (*MixMatcher) LoadFormFile added in v0.21.0

func (m *MixMatcher) LoadFormFile(file string) error

LoadFormFile loads data from file. File can be a text file or a v2ray data file. v2ray data file needs to specify the data category by using ':', e.g. 'geosite:cn' v2ray data file can also have multiple @attr. e.g. 'geosite:cn@attr1@attr2'. Only the domain with all of the @attr will be used.

func (*MixMatcher) LoadFormText added in v0.21.0

func (m *MixMatcher) LoadFormText(s string, parseValue ParseValueFunc) error

func (*MixMatcher) LoadFormTextFile added in v0.21.0

func (m *MixMatcher) LoadFormTextFile(file string, parseValue ParseValueFunc) error

func (*MixMatcher) LoadFormTextReader added in v0.21.0

func (m *MixMatcher) LoadFormTextReader(r io.Reader, parseValue ParseValueFunc) error

func (*MixMatcher) Match added in v0.19.1

func (m *MixMatcher) Match(fqdn string) (v interface{}, ok bool)

type ParseValueFunc added in v0.21.0

type ParseValueFunc func([]string) (interface{}, error)

type RegexMatcher added in v0.19.1

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

func NewRegexMatcher added in v0.19.1

func NewRegexMatcher() *RegexMatcher

func (*RegexMatcher) Add added in v0.19.1

func (m *RegexMatcher) Add(expr string, v interface{}) error

func (*RegexMatcher) Match added in v0.19.1

func (m *RegexMatcher) Match(fqdn string) (v interface{}, ok bool)

type V2Matcher

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

func NewV2Matcher

func NewV2Matcher(domains []*router.Domain) (*V2Matcher, error)

func (*V2Matcher) Match

func (m *V2Matcher) Match(fqdn string) (v interface{}, ok bool)

Jump to

Keyboard shortcuts

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