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).Lookup
now takes only the IP address and returns aResult
.Lookup(ip, &rec)
would now becomeLookup(ip).Decode(&rec)
.(*Reader).LookupNetwork
has been removed. To get the network for a result, use(Result).Prefix()
.(*Reader).LookupOffset
now takes an offset and returns aResult
.Result
has anOffset()
method that returns the offset value.(*Reader).Decode
has been removed.- Use of
net.IP
and*net.IPNet
have been replaced withnetip.Addr
andnetip.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).Networks
and(*Reader).NetworksWithin
now return a Go 1.23 iterator ofResult
values. Aliased networks are now skipped by default. If you wish to include them, use theIncludeAliasedNetworks
option.
1.13.1
- Return the
*net.IPNet
in canonical form when usingNetworksWithin
to look up a network more specific than the one in the database. Previously, theIP
field on the*net.IPNet
would be set to the IP from the lookup network rather than the first IP of the network. NetworksWithin
will now correctly handle an*net.IPNet
parameter that is not in canonical form. This issue would only occur if the*net.IPNet
was manually constructed, asnet.ParseCIDR
returns the value in canonical form even if the input string is not.
1.13.0
1.12.0
- The
wasi
target 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.SkipAliasedNetworks
option toNetworks
and
NetworksWithin
methods. 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.