geoip

package
v0.0.0-...-e7fbf99 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2020 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGeoIP

func GetGeoIP(ctx *bot.Context) string

GetGeoIP makes request to API and returns geoip data formatted to string

Types

type GeoIP

type GeoIP struct {
	IP        string       `json:"ip"`
	City      GeoIPCity    `json:"city"`
	Region    GeoIPRegion  `json:"region"`
	Country   GeoIPCountry `json:"country"`
	Error     string       `json:"error"`
	Requests  int          `json:"requests"`
	Created   string       `json:"created"`
	TimeStamp int          `json:"timestamp"`
}

GeoIP main geoip structure. Contains geographic data about ip address

type GeoIPCity

type GeoIPCity struct {
	Id         int     `json:"id"`
	Latitude   float64 `json:"lat"`
	Longitude  float64 `json:"lon"`
	NameRU     string  `json:"name_ru"`
	NameEN     string  `json:"name_en"`
	OKATO      string  `json:"okato"`
	VK         int     `json:"vk"`
	Population int     `json:"population"`
	Tel        string  `json:"tel"`
	PostalCode string  `json:"post"`
}

GeoIPCity contains data about city

type GeoIPCountry

type GeoIPCountry struct {
	ID            int     `json:"id"`
	Latitude      float64 `json:"lat"`
	Longitude     float64 `json:"lon"`
	NameRU        string  `json:"name_ru"`
	NameEN        string  `json:"name_en"`
	ISO           string  `json:"iso"`
	Continent     string  `json:"continent"`
	TimeZone      string  `json:"timezone"`
	Area          int     `json:"area"`
	Population    int     `json:"population"`
	CapitalID     int     `json:"capital_id"`
	CapitalNameRU string  `json:"capital_ru"`
	CapitalNameEN string  `json:"capital_en"`
	CurrencyCode  string  `json:"cur_code"`
	PhonePrefix   string  `json:"phone"`
	Neighbours    string  `json:"neighbours"`
	VK            int     `json:"vk"`
	UTC           int     `json:"utc"`
}

GeoIPCountry contains data about country

type GeoIPRegion

type GeoIPRegion struct {
	Id        int     `json:"id"`
	Latitude  float64 `json:"lat"`
	Longitude float64 `json:"lon"`
	NameRU    string  `json:"name_ru"`
	NameEN    string  `json:"name_en"`
	OKATO     string  `json:"okato"`
	VK        int     `json:"vk"`
	ISO       string  `json:"iso"`
	TimeZone  string  `json:"timezone"`
	Auto      string  `json:"auto"`
	UTC       int     `json:"utc"`
}

GeoIPRegion contains data about region

Jump to

Keyboard shortcuts

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