geo

package
v0.0.0-...-a1df8f8 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_DISTANCE = 360

Variables

This section is empty.

Functions

This section is empty.

Types

type Location

type Location struct {
	Country     string
	Continent   string
	RegionGroup string
	Region      string
	Latitude    float64
	Longitude   float64
	Netmask     int
}

func (*Location) Distance

func (l *Location) Distance(to *Location) float64

func (*Location) MaxDistance

func (l *Location) MaxDistance() float64

type Provider

type Provider interface {
	HasCountry() (bool, error)
	GetCountry(ip net.IP) (country, continent string, netmask int)
	HasASN() (bool, error)
	GetASN(net.IP) (asn string, netmask int, err error)
	HasLocation() (bool, error)
	GetLocation(ip net.IP) (location *Location, err error)
}

Jump to

Keyboard shortcuts

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