geolocation

package
v0.0.0-...-000e973 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2019 License: BSD-2-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlatMap

func FlatMap() (flatmap *sm.Context)

FlatMap - Create the context for the flatmap

func FlatMapAddMarker

func FlatMapAddMarker(flatmap *sm.Context, lat float64, lon float64)

FlatMapAddMarker - Add markers in the flatmap

func FlatMapRender

func FlatMapRender(flatmap *sm.Context) (err error)

FlatMapRender - Render the image for the flat map

func GetLatLon

func GetLatLon(ipAddress string) (lat float64, lon float64, country string, err error)

GetLatLon - Get lat and lon of the WAN IP

func GetLocalIPv4

func GetLocalIPv4(iface string) (ifaceip net.IP)

GetLocalIPv4 - Return the local machine WAN ip

func GlobeMap

func GlobeMap() (globemap *globe.Globe)

GlobeMap - Create the context for the globemap

func GlobeMapAddMarker

func GlobeMapAddMarker(globemap *globe.Globe, lat float64, lon float64)

GlobeMapAddMarker - Add markers in the globemap

func GlobeMapRender

func GlobeMapRender(globemap *globe.Globe, myWanLat float64, myWanLon float64)

GlobeMapRender - Render the image for the globe map

func SetCountriesNumber

func SetCountriesNumber(countryName string)

SetCountriesNumber - Create a map and set the number of nodes in each country

Types

type GeoLocation

type GeoLocation struct {
	As          string  `json:"as"`
	City        string  `json:"city"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Isp         string  `json:"isp"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Org         string  `json:"org"`
	Query       string  `json:"query"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	Status      string  `json:"status"`
	Timezone    string  `json:"timezone"`
	Zip         string  `json:"zip"`
}

GeoLocation - Get info from https://ip-api.com

type NodeInfo

type NodeInfo struct {
	Listeners []string `json:"listeners"`
	PublicKey string   `json:"publicKey"`
}

NodeInfo - Get a list of nodes connected to each other

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳