geolite2

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package geolite2 returns the city or country location of an IP address. The IP region data is from GeoLite2 created by MaxMind, available from https://www.maxmind.com. © Ben Garrett https://github.com/bengarrett/myip

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func City

func City(ip string) (string, error)
Example
s, err := City("93.184.216.34")
if err != nil {
	log.Fatal(err)
}
fmt.Println(s)
Output:

Norwell, United States

func Country

func Country(ip string) (string, error)
Example
s, err := Country("93.184.216.34")
if err != nil {
	log.Fatal(err)
}
fmt.Println(s)
Output:

United States

Types

This section is empty.

Jump to

Keyboard shortcuts

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