Categorygithub.com/rainhq/maxminddb-golang/v2
modulepackage
2.1.7
Repository: https://github.com/rainhq/maxminddb-golang.git
Documentation: pkg.go.dev

# README

MaxMind DB Reader for Go

GoDoc

This is a Go reader for the MaxMind DB format. Although this can be used to read GeoLite2 and GeoIP2 databases, geoip2 provides a higher-level API for doing so.

This is not an official MaxMind API.

Installation

go get github.com/oschwald/maxminddb-golang

Usage

See GoDoc for documentation and examples.

Examples

See GoDoc or example_test.go for examples.

Contributing

Contributions welcome! Please fork the repository and open a pull request with your changes.

License

This is free software, licensed under the ISC License.

# Functions

FromBytes takes a byte slice corresponding to a MaxMind DB file and returns a Reader structure or an error.
IncludeAliasedNetworks is an option for Networks and NetworksWithin that makes them iterate over aliases of the IPv4 subtree in an IPv6 database, e.g., ::ffff:0:0/96, 2001::/32, and 2002::/16.
Open takes a string path to a MaxMind DB file and returns a Reader structure or an error.

# Structs

InvalidDatabaseError is returned when the database contains invalid data and cannot be parsed.
Metadata holds the metadata decoded from the MaxMind DB file.
Reader holds the data corresponding to the MaxMind DB file.
No description provided by the author
UnmarshalTypeError is returned when the value in the database cannot be assigned to the specified data type.

# Type aliases

NetworksOption are options for Networks and NetworksWithin.