geoip

package
v0.27.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Overview

Package geoip helps in geolocation operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Locator

type Locator interface {
	// GetCountry retrieves the ISO country code for a given IP address.
	// Returns an error if the IP lookup fails.
	GetCountry(ip net.IP) (string, error)

	// GetPosition retrieves the geographical [Position] for a given IP
	// address. Returns an error if the IP lookup fails.
	GetPosition(ip net.IP) (Position, error)
}

func NewNullGeoLite

func NewNullGeoLite() Locator

NewNullGeoLite returns a no-op Locator that resolves every IP to an empty result. It is the Community Edition fallback; the real MaxMind-backed locator lives in the cloud/enterprise build.

type Position

type Position struct {
	Longitude, Latitude float64
}

Position represents a position, longitude and latitude, in the globe.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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