package
0.0.0-20220308170854-f83cb7a5233c
Repository: https://github.com/m-lab/annotation-service.git
Documentation: pkg.go.dev

# README

Maxmind GeoIP API for Go

This package wraps the libgeoip C library for access from Go (golang).

install pkg-config and libgeoip-dev.

There's a small example in the ex/ subdirectory.

You can download the free GeoLite Country database or you can subscribe to updates.

# Functions

LoadAnnotator loads a legacy Annotator from a GCS object.
LoadGeoliteDataset will check GCS for the matching dataset, download it, process it, and load it into memory so that it can be easily searched, then it will return a pointer to that GeoDataset or an error.
LoadLegacyDataset loads the requested dataset into memory.

# Variables

ErrDatasetNotLoaded is returned when the IPv4 or IPv6 dataset was not loaded properly.
ErrDateExtractionFailed is returned when no valid date can be extracted from filename.
ErrInvalidDatasetFilename is returned when provided dataset filename is invalid.
ErrLoadLegacyFailed is returned when loading the legacy dataset failed.
ErrNoRecord is returned when there is no record for requested IP in the dataset.
Fips2ISOMapFile is the name of the FIPS to ISO csv file.

# Structs

Annotator contains pointer to the dataset used to hold and lookup IP data.