Releases: oschwald/maxminddb-golang
Releases · oschwald/maxminddb-golang
2.0.0-beta.1
This is the first beta of the v2 releases. Go 1.23 is required. I don't expect to do a final release until Go 1.24 is available. See #141 for the v2 roadmap.
Notable changes:
(*Reader).Lookupnow takes only the IP address and returns aResult.Lookup(ip, &rec)would now becomeLookup(ip).Decode(&rec).(*Reader).LookupNetworkhas been removed. To get the network for a result, use(Result).Prefix().(*Reader).LookupOffsetnow takes an offset and returns aResult.Resulthas anOffset()method that returns the offset value.(*Reader).Decodehas been removed.- Use of
net.IPand*net.IPNethave been replaced withnetip.Addrandnetip.Prefix. - You may now decode a particular path within a database record using
(Result).DecodePath. For instance, to decode just the country code in GeoLite2 Country to a string calledcode, you might do something likeLookup(ip).DecodePath(&code, "country", "iso_code"). Strings should be used for map keys and ints for array indexes. (*Reader).Networksand(*Reader).NetworksWithinnow return a Go 1.23 iterator ofResultvalues. Aliased networks are now skipped by default. If you wish to include them, use theIncludeAliasedNetworksoption.
1.13.1
- Return the
*net.IPNetin canonical form when usingNetworksWithinto look up a network more specific than the one in the database. Previously, theIPfield on the*net.IPNetwould be set to the IP from the lookup network rather than the first IP of the network. NetworksWithinwill now correctly handle an*net.IPNetparameter that is not in canonical form. This issue would only occur if the*net.IPNetwas manually constructed, asnet.ParseCIDRreturns the value in canonical form even if the input string is not.
1.13.0
1.12.0
- The
wasitarget is now built without memory-mapping support. Pull request
by Alex Kashintsev. GitHub #114. - When decoding to a map of non-scalar, non-interface types such as a
map[string]map[string]any, the decoder failed to zero out the value for
the map elements, which could result in incorrect decoding. Reported by
JT Olio. GitHub #115.
1.11.0
1.10.0
1.9.0
1.8.0
- Added
maxminddb.SkipAliasedNetworksoption toNetworksand
NetworksWithinmethods. When set, this option will cause the
iterator to skip networks that are aliases of the IPv4 tree. - Added experimental custom deserializer support. This allows
much more control over the deserialization. The API is
subject to change and you should use at your own risk.
1.7.0
1.6.0
- This module now uses Go modules. Requested by Matthew Rothenberg.
GitHub #49. - Plan 9 is now supported. Pull request by Jacob Moody. GitHub #61.
- Documentation fixes. Pull request by Olaf Alders. GitHub #62.
- Thread-safety is now mentioned in the documentation. Requested by
Ken Sedgwick. GitHub #39. - Fix off-by-one error in file offset safety check. Reported by Will
Storey. GitHub #63.