Releases: oschwald/maxminddb-golang
Releases · oschwald/maxminddb-golang
2.0.0
- BREAKING CHANGE: Removed deprecated
FromBytes. UseOpenBytesinstead. - Fixed verifier metadata error message to require a non-empty map for the
database description. GitHub #187. - Introduces the v2 API with
Reader.Lookup(ip).Decode(...),netip.Addr
support, custom decoder interfaces, and richer error reporting. - See MIGRATION.md for guidance on upgrading projects from v1 to v2.
2.0.0-beta.10
- Replaced
runtime.SetFinalizerwithruntime.AddCleanupfor resource
cleanup in Go 1.24+. This provides more reliable finalization behavior and
better garbage collection performance.
2.0.0-beta.9
- SECURITY: Fixed integer overflow vulnerability in search tree size
calculation that could potentially allow malformed databases to trigger
security issues. - SECURITY: Enhanced bounds checking in tree traversal functions to return
proper errors instead of silent failures when encountering malformed
databases. - Added validation for invalid prefixes in
NetworksWithinto prevent
unexpected behavior with malformed input. - Added
SkipEmptyValues()option forNetworksandNetworksWithinto skip
networks whose data is an empty map or empty array. This is useful for
databases that store empty maps or arrays for records without meaningful
data. GitHub #172. - Optimized custom unmarshaler type assertion to use Go 1.25's
reflect.TypeAssertwhen available, reducing allocations in reflection code
paths. - Improved memory mapping implementation by using
SyscallConn()instead of
Fd()to avoid side effects and prepare for Go 1.25+ Windows I/O
enhancements. Pull request by database64128. GitHub #179. - Added
OpenBytesfunction for better API discoverability and consistency
withOpen().FromBytesis now deprecated and will be removed in a future
version.
2.0.0-beta.8
2.0.0-beta.8
- Fixed "no next offset available" error that occurred when using custom
unmarshalers that decode container types (maps, slices) in struct fields.
The reflection decoder now correctly calculates field positions when
advancing to the next field after custom unmarshaling.
v2.0.0-beta.7
2.0.0-beta.7
- Update capitalization of "uint" in
ReadUInt*to matchKindUint*as well
as the Go standard library.
2.0.0-beta.6
2.0.0-beta.6
- Update capitalization of "uint" in
ReadUInt*to matchKindUint*as well
as the Go standard library.
2.0.0-beta.5
2.0.0-beta.5
- Added
Offset()method toDecoderto get the current database offset. This
enables custom unmarshalers to implement caching for improved performance when
loading databases with duplicate data structures. - Fixed infinite recursion in pointer-to-pointer data structures, which are
invalid per the MaxMind DB specification.
2.0.0-beta-4
- BREAKING CHANGE: Removed experimental
deserializerinterface and
supporting code. Applications using this interface should migrate to the
Unmarshalerinterface by implementingUnmarshalMaxMindDB(d *Decoder) error
instead. OpenandFromBytesnow accept options.- BREAKING CHANGE:
IncludeNetworksWithoutDataandIncludeAliasedNetworks
now return aNetworksOptionrather than being one themselves. These must now
be called as functions:Networks(IncludeAliasedNetworks())instead of
Networks(IncludeAliasedNetworks). This was done to improve the documentation
organization. - Added
Unmarshalerinterface to allow custom decoding implementations for
performance-critical applications. Types implementing
UnmarshalMaxMindDB(d *Decoder) errorwill automatically use custom decoding
logic instead of reflection, following the same pattern as
json.Unmarshaler. - Added public
Decodertype andKindconstants inmmdbdatapackage for
manual decoding.Decoderprovides methods likeReadMap(),ReadSlice(),
ReadString(),ReadUInt32(),PeekKind(), etc.Kindtype includes
helper methodsString(),IsContainer(), andIsScalar()for type
introspection. The mainmaxminddbpackage re-exports these types for
backward compatibility.NewDecoder()supports an options pattern for
future extensibility. - Enhanced
UnmarshalMaxMindDBto work with nested struct fields, slice
elements, and map values. The custom unmarshaler is now called recursively
for any type that implements theUnmarshalerinterface, similar to
encoding/json. - Improved error messages to include byte offset information and, for the
reflection-based API, path information for nested structures using JSON
Pointer format. For example, errors may now show "at offset 1234, path
/city/names/en" or "at offset 1234, path /list/0/name" instead of just the
underlying error message. - PERFORMANCE: Added string interning optimization that reduces allocations
while maintaining thread safety. Reduces allocation count from 33 to 10 per
operation in downstream libraries. Uses a fixed 512-entry cache with per-entry
mutexes for bounded memory usage (~8KB) while minimizing lock contention.
2.0.0-beta.3
Openwill now fall back to loading the database in memory if the file-system does not supportmmap. Pull request by database64128. GitHub #163.- Made significant improvements to the Windows memory-map handling. . GitHub #162.
- Fix an integer overflow on large databases when using a 32-bit architecture. See ipinfo/mmdbctl#33.