ipapi

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var EnableQuery bool = true
View Source
var ErrQueryDisabled = errors.New("ipapi: Query disabled by user.")

Functions

This section is empty.

Types

type Result

type Result 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"`
	TimeZone    string  `json:"timezone"`
	Zip         string  `json:"zip"`
}
var MockResult *Result = nil

func Query

func Query() (*Result, error)

func QueryCached added in v0.1.0

func QueryCached(cachePath string, l *zap.Logger) (*Result, error)

Jump to

Keyboard shortcuts

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