iploc

package
v1.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package iploc provides fast IP to country lookup using embedded binary data generated from MaxMind GeoLite2-Country database.

The binary format is optimized for fast lookups using binary search over little-endian range boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Country

func Country(ip net.IP) string

Country returns the ISO 3166-1 alpha-2 country code for the given net.IP. Returns an empty string if the country cannot be determined.

func IPCountry

func IPCountry(ip netip.Addr) (country string)

IPCountry returns the ISO 3166-1 alpha-2 country code for the given netip.Addr. Returns an empty string if the country cannot be determined.

Types

This section is empty.

Directories

Path Synopsis
Command generate converts MaxMind GeoLite2-Country.mmdb to iploc binary format.
Command generate converts MaxMind GeoLite2-Country.mmdb to iploc binary format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL