This commit is contained in:
Urle Sistiana
2022-12-15 11:19:07 +08:00
commit fc8c213056
16 changed files with 1915 additions and 0 deletions

19
v2data/loader.go Normal file
View File

@@ -0,0 +1,19 @@
package v2data
import "google.golang.org/protobuf/proto"
func LoadGeoSiteList(b []byte) (*GeoSiteList, error) {
geoSiteList := new(GeoSiteList)
if err := proto.Unmarshal(b, geoSiteList); err != nil {
return nil, err
}
return geoSiteList, nil
}
func LoadGeoIPListFromDAT(b []byte) (*GeoIPList, error) {
geoIP := new(GeoIPList)
if err := proto.Unmarshal(b, geoIP); err != nil {
return nil, err
}
return geoIP, nil
}