mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-05 19:28:45 +00:00
18 lines
359 B
Go
18 lines
359 B
Go
|
|
package geodata
|
||
|
|
|
||
|
|
type IPRegistry struct {
|
||
|
|
ipsetFactory *IPSetFactory
|
||
|
|
}
|
||
|
|
|
||
|
|
func (r *IPRegistry) BuildIPMatcher(rules []*IPRule) (IPMatcher, error) {
|
||
|
|
return buildOptimizedIPMatcher(r.ipsetFactory, rules)
|
||
|
|
}
|
||
|
|
|
||
|
|
func newIPRegistry() *IPRegistry {
|
||
|
|
return &IPRegistry{
|
||
|
|
ipsetFactory: &IPSetFactory{shared: make(map[string]*IPSet)},
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
var IPReg = newIPRegistry()
|