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

# Functions

BuildIPNodeList is a modified version of geolite2.LoadIPListGLite2 implementation.
CIDRRange returns the IP range in CIDR notation and works for both IPv4 and IPv6 addresses.
ParseIPWithMetrics parses an IP address string, returning a net.IP, or parse error.
SearchBinary does a binary search for a list element in the specified list.

# Variables

ErrEmptyIP is returned for IP address strings that are empty.
ErrInvalidIP is returned for non-empty IP address strings that cannot be parsed.
ErrNodeNotFound raised when a node is not found during SearchBinary.
ErrorTooManyErrors raised when the maximum number of errors during the import of a single file is > then maxWrongRecordsPerFile.

# Structs

BaseIPNode is a basic type for nodes to handle.

# Interfaces

IPNode interface enables the abstraction of different kind of IP nodes to reuse the list building, binary search logic.
IPNodeParser interface enables the abstraction of processing the source data with the common logic.