mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-05-08 14:13:22 +00:00
https://github.com/XTLS/Xray-core/issues/4422#issuecomment-3533007890 Breaking changes https://github.com/XTLS/Xray-core/pull/5569 Reverts https://github.com/XTLS/Xray-core/pull/5505 Closes https://github.com/XTLS/Xray-core/pull/643
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()
|