geoip2-golang icon indicating copy to clipboard operation
geoip2-golang copied to clipboard

add support for asn network range

Open the-siegfried opened this issue 7 months ago • 2 comments
trafficstars

  • Updates the ASN type to support the network range field.
  • Refactors the ASN method to utilise the LookupNetwork method of the mmdbReader in order to capture the network address and subnet.

See Issue: #128

the-siegfried avatar Apr 03 '25 22:04 the-siegfried

If we were to add this, we would add it to all the lookup types and make the value a netip.Prefix rather than a string. I would probably hold off doing that until we upgrade to maxminddb-golang/v2 though.

In the meantime, it is easy to use the models in this package with github.com/oschwald/maxmind-golang or github.com/oschwald/maxmind-golang/v2. I would suggest doing that for now.

oschwald avatar Apr 03 '25 23:04 oschwald

Thanks for the heads up @oschwald. I'll give that a go.

the-siegfried avatar Apr 04 '25 08:04 the-siegfried

This has been added in 2.0.0-beta.1.

oschwald avatar Jun 22 '25 21:06 oschwald