Documentation ¶
Index ¶
- type DomainMatcher
- type KeywordMatcher
- type MatchMode
- type Matcher
- type MatcherGroup
- type MixMatcher
- func (m *MixMatcher) AddElem(typ router.Domain_Type, s string, v interface{}) error
- func (m *MixMatcher) LoadFormDAT(file, countryCode string, attr []string) error
- func (m *MixMatcher) LoadFormFile(file string) error
- func (m *MixMatcher) LoadFormText(s string, parseValue ParseValueFunc) error
- func (m *MixMatcher) LoadFormTextFile(file string, parseValue ParseValueFunc) error
- func (m *MixMatcher) LoadFormTextReader(r io.Reader, parseValue ParseValueFunc) error
- func (m *MixMatcher) Match(fqdn string) (v interface{}, ok bool)
- type ParseValueFunc
- type RegexMatcher
- type V2Matcher
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 Matcher ¶
func NewV2MatcherFromFile ¶
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 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)
Click to show internal directories.
Click to hide internal directories.