geoip

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// DefaultLookupURL gives Fleet Map a Nezha-like no-token auto-location path.
	// Operators who do not want node public IPs sent to a public provider can set
	// LATTICE_GEOIP_LOOKUP_URL=off or point the setting at an internal service.
	DefaultLookupURL = "https://ipwho.is/{ip}"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPResolver

type HTTPResolver struct {
	// contains filtered or unexported fields
}

func NewHTTPResolver

func NewHTTPResolver(template string) (*HTTPResolver, error)

func (*HTTPResolver) Lookup

func (r *HTTPResolver) Lookup(ctx context.Context, ip string) (Result, error)

type Resolver

type Resolver interface {
	Lookup(ctx context.Context, ip string) (Result, error)
}

type Result

type Result struct {
	IP       string
	Country  string
	Region   string
	City     string
	Lat      float64
	Lon      float64
	ASN      int
	ASOrg    string
	Provider string
}

Result is a normalized location returned by a GeoIP provider. Coordinates are mandatory because the dashboard map cannot place a country-only result.

Jump to

Keyboard shortcuts

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