iplocation

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 1 Imported by: 0

Documentation

Overview

Package iplocation detects your location based on your IP.

Index

Constants

View Source
const URL = "http://ip-api.com/json"

URL points to the location of the IP locale info API.

Variables

This section is empty.

Functions

This section is empty.

Types

type Data

type Data struct {
	Status      string  `json:"status"`
	Country     string  `json:"country"`
	CountryCode string  `json:"countryCode"`
	Region      string  `json:"region"`
	RegionName  string  `json:"regionName"`
	City        string  `json:"city"`
	Zip         string  `json:"zip"`
	Lat         float64 `json:"lat"`
	Lon         float64 `json:"lon"`
	Timezone    string  `json:"timezone"`
	ISP         string  `json:"isp"`
	ORG         string  `json:"org"`
	AS          string  `json:"as"`
	Message     string  `json:"message"`
	Query       string  `json:"query"`
}

Data will hold the result of the query to get the IP address of the caller.

func Get

func Get() (*Data, error)

Get will get the location details based on current IP location.

Jump to

Keyboard shortcuts

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