mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-12 07:08:41 +00:00
Refactor: GeoSite & GeoIP
This commit is contained in:
parent
8382b29922
commit
b11429eaee
54 changed files with 2110 additions and 1633 deletions
19
common/matcher/geosite/geosite.go
Normal file
19
common/matcher/geosite/geosite.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package geosite
|
||||
|
||||
import "github.com/xtls/xray-core/common/matcher/domain"
|
||||
|
||||
//go:generate go run github.com/xtls/xray-core/common/errors/errorgen
|
||||
|
||||
func ToDomains(dms []*Domain) []*domain.Domain {
|
||||
dm := make([]*domain.Domain, len(dms))
|
||||
|
||||
for idx, entry := range dms {
|
||||
dm[idx] = entry.ToDomain()
|
||||
}
|
||||
|
||||
return dm
|
||||
}
|
||||
|
||||
func (d *Domain) ToDomain() *domain.Domain {
|
||||
return &domain.Domain{Type: d.Type, Value: d.Value}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue