ip

package
v0.0.0-...-795d1ad Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IpService

type IpService struct {
	// contains filtered or unexported fields
}

func NewIpService

func NewIpService(token string) *IpService

func (*IpService) Lookup

func (t *IpService) Lookup(request *LookupRequest) (*LookupResponse, error)

Lookup the geolocation information for an IP address

type LookupRequest

type LookupRequest struct {
	// IP to lookup
	Ip string `json:"ip"`
}

type LookupResponse

type LookupResponse struct {
	// Autonomous system number
	Asn int32 `json:"asn"`
	// Name of the city
	City string `json:"city"`
	// Name of the continent
	Continent string `json:"continent"`
	// Name of the country
	Country string `json:"country"`
	// IP of the query
	Ip string `json:"ip"`
	// Latitude e.g 52.523219
	Latitude float64 `json:"latitude"`
	// Longitude e.g 13.428555
	Longitude float64 `json:"longitude"`
	// Timezone e.g Europe/Rome
	Timezone string `json:"timezone"`
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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