Documentation ¶
Index ¶
- func LoadGeoSiteFromDAT(file, countryCode string) (*v2data.GeoSite, error)
- func LoadGeoSiteList(file string) (*v2data.GeoSiteList, error)
- type DomainMatcher
- type FilterRecordFunc
- type KeywordMatcher
- type MatchMode
- type Matcher
- type MatcherGroup
- type MixMatcher
- func (m *MixMatcher) AddElem(typ v2data.Domain_Type, s string, v interface{}) error
- func (m *MixMatcher) LoadFormDAT(file, countryCode string, filterRecord FilterRecordFunc, ...) error
- func (m *MixMatcher) LoadFormFile(file string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
- func (m *MixMatcher) LoadFormFileAsV2Matcher(file string) error
- func (m *MixMatcher) LoadFormText(s string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
- func (m *MixMatcher) LoadFormTextFile(file string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
- func (m *MixMatcher) LoadFormTextReader(r io.Reader, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
- func (m *MixMatcher) Match(fqdn string) (v interface{}, ok bool)
- type ParseValueFunc
- type RegexMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadGeoSiteFromDAT ¶ added in v0.24.0
func LoadGeoSiteList ¶ added in v0.24.0
func LoadGeoSiteList(file string) (*v2data.GeoSiteList, error)
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 FilterRecordFunc ¶ added in v0.22.0
FilterRecordFunc determines whether a record is acceptable. The given []string could have a 0 length or is nil.
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 BatchLoadMixMatcherV2Matcher ¶ added in v0.22.0
BatchLoadMixMatcherV2Matcher loads multiple files using MixMatcher.LoadFormFileAsV2Matcher
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 BatchLoadMixMatcher ¶ added in v0.22.0
func BatchLoadMixMatcher(f []string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) (*MixMatcher, error)
BatchLoadMixMatcher loads multiple files using MixMatcher.LoadFormFile
func NewMixMatcher ¶ added in v0.19.1
func NewMixMatcher() *MixMatcher
func (*MixMatcher) AddElem ¶ added in v0.19.1
func (m *MixMatcher) AddElem(typ v2data.Domain_Type, s string, v interface{}) error
func (*MixMatcher) LoadFormDAT ¶ added in v0.21.0
func (m *MixMatcher) LoadFormDAT(file, countryCode string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
func (*MixMatcher) LoadFormFile ¶ added in v0.21.0
func (m *MixMatcher) LoadFormFile(file string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
LoadFormFile loads data from file.
func (*MixMatcher) LoadFormFileAsV2Matcher ¶ added in v0.22.0
func (m *MixMatcher) LoadFormFileAsV2Matcher(file string) error
LoadFormFileAsV2Matcher loads data from a 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, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
func (*MixMatcher) LoadFormTextFile ¶ added in v0.21.0
func (m *MixMatcher) LoadFormTextFile(file string, filterRecord FilterRecordFunc, parseValue ParseValueFunc) error
func (*MixMatcher) LoadFormTextReader ¶ added in v0.21.0
func (m *MixMatcher) LoadFormTextReader(r io.Reader, filterRecord FilterRecordFunc, 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
ParseValueFunc parses additional `attr` to an interface. The given []string could have a 0 length or is nil.
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)