geoipmap

package
v0.0.0-...-456f7df Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UpdateGeoLocationInfo

func UpdateGeoLocationInfo(d map[string]interface{}, g *GeoIPCollector) error

Types

type GeoIPCollector

type GeoIPCollector struct {
	CityDB       *geoip2.Reader
	ASNDB        *geoip2.Reader
	Default_Lat  float64
	Default_Long float64
}

func NewGeoIPCollector

func NewGeoIPCollector(citymmdb string, asnmmdb string, defaultLat float64, defaultLong float64) (*GeoIPCollector, error)

func (*GeoIPCollector) Lookup

func (g *GeoIPCollector) Lookup(ip net.IP) GeoLocation

type GeoLocation

type GeoLocation struct {
	City           string
	Region         string
	Country        string
	ASN            string
	AccuracyRadius uint16
	Location       *elastic.GeoPoint `json:"location"`
}

Jump to

Keyboard shortcuts

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