Back to godoc.org

Package ipapi

v0.2.2
Latest Go to latest

The latest major version is .

Published: May 30, 2020 | License: Apache-2.0 | Module: github.com/IPA-CyberLab/kmgm

Index

Constants

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

Variables

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

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

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier