geo

package
v1.3.106 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Overview

Package geo pkg/geo/geo.go c0-com-util

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIPIsNotPublic         = errors.New("ip address is not public")
	ErrCannotObtainLocFromIP = errors.New("cannot obtain location from IP")
)

Errors associated with geo calls.

Functions

This section is empty.

Types

type LocationData

type LocationData struct {
	Lat     float64 `json:"lat,omitempty"`
	Lon     float64 `json:"lon,omitempty"`
	Country string  `json:"country,omitempty"`
	Region  string  `json:"region,omitempty"`
}

LocationData represents a geolocation point.

type LocationDetails

type LocationDetails func(ip net.IP) (*LocationData, error)

LocationDetails represents a function that obtains geolocation from a given IP.

func MakeIPDetails

func MakeIPDetails(log logrus.FieldLogger, geoip string) LocationDetails

MakeIPDetails returns a GeoFunc.

Jump to

Keyboard shortcuts

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