This library reads MaxMind GeoLite2 and GeoIP2 databases. This library is built using the Go maxminddb reader. All data for the database record is decoded using this library. If you only need several fields, you may get superior performance by using maxminddb's Lookup directly with a result struct that only contains the required fields. (See example_test.go in the maxminddb repository for an example of this.) Metadata takes no arguments and returns a struct containing metadata about the...
...OpenFile opens or creates a DB for the given path. The DB will be created if not exist, unless ErrorIfMissing is true. Also, if ErrorIfExist is true and the DB exist OpenFile will returns os.ErrExist error. OpenFile uses standard file-system backed storage implementation as described in the leveldb/storage package. OpenFile will return an error with type of ErrCorrupted if corruption is detected in the DB. Use errors.IsCorrupted to test whether an error is due to corruption. Corrupted DB can be recovered with Recover function. CompactRange compacts the underlying DB for the given key range. ...