regionmap

package
v0.0.0-...-8e88d4a Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package regionmap maps IP address location info to region names.

The region names are primarily determined based on the country, but also use state/province/region names for larger countries. The mapping is based on a combination of data from:

The current mapping was created on November 20, 2022.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRegion

func GetRegion(ip netip.Addr, r ip2x.Record) (string, error)

GetRegion gets the region name for the provided IP address and IP2Location record. The IP2Location record should have at least CountryShort and Region fields. If the location is unrecognized, a best-effort region and an error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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