MaxMind DB Reader for Go
ISC License
Bot releases are visible (Hide)
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 a Result
. Lookup(ip, &rec)
would now become Lookup(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 a Result
. Result
has an Offset()
method that returns the offset value. (*Reader).Decode
has been removed.net.IP
and *net.IPNet
have been replaced with netip.Addr
and netip.Prefix
.(Result).DecodePath
. For instance, to decode just the country code in GeoLite2 Country to a string called code
, you might do something like Lookup(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 of Result
values. Aliased networks are now skipped by default. If you wish to include them, use the IncludeAliasedNetworks
option.Published by oschwald 4 months ago
*net.IPNet
in canonical form when using NetworksWithin
to look up a network more specific than the one in the database. Previously, the IP
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, as net.ParseCIDR
returns the value in canonical form even if the input string is not.Published by oschwald 5 months ago
Published by oschwald about 1 year ago
wasi
target is now built without memory-mapping support. Pull requestmap[string]map[string]any
, the decoder failed to zero out the value forPublished by oschwald over 1 year ago
wasm
and wasip1
targets are now built without memory-mapping support.Full Changelog: https://github.com/oschwald/maxminddb-golang/compare/v1.10.0...v1.11.0
Published by oschwald about 2 years ago
Published by oschwald over 2 years ago
Published by oschwald almost 4 years ago
maxminddb.SkipAliasedNetworks
option to Networks
andNetworksWithin
methods. When set, this option will cause thePublished by oschwald over 4 years ago
NetworksWithin
method. This returns an iterator that traverses all networks in the database that are contained in the given network. Pull request by Olaf Alders. GitHub #65.Published by oschwald almost 5 years ago
Published by oschwald about 5 years ago
Published by oschwald about 5 years ago
LookupNetwork
. This returns the network that thePublished by oschwald about 5 years ago
Published by oschwald over 6 years ago
maxminddb.Reader
struct now return an error ifClose
method on the maxminddb.Reader
struct now sets theFromBytes
or Open
onsyscall
Published by oschwald almost 7 years ago
Published by oschwald over 7 years ago
libmaxminddb
. All MaxMind databases currently have a depth of less than five.Published by oschwald almost 8 years ago
r.Close()
is still recommended for most use cases.[]byte
and string was used tostring([]byte)
map lookups to achieveunsafe
.Published by oschwald almost 8 years ago
New release for those using tagged releases.