geo

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package geo resolves a client IP to an ISO 3166-1 alpha-2 country code using a pure-Go, embedded database (no external service, no file to mount). It is privacy-preserving by construction: callers resolve the country at request time and immediately discard the IP — GateCHA never stores or logs the raw address, only the aggregated country.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Country

func Country(ip string) string

Country returns the uppercase ISO 3166-1 alpha-2 code for ip, or "" when the address is empty, unparseable, private/loopback/link-local, or unknown to the embedded database. An empty result means "unknown" and should render without a flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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