geo

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoEntry

type GeoEntry struct {
	IPAddress string    `json:"ipAddress"`
	UserAgent string    `json:"userAgent"`
	Country   string    `json:"country"`
	Region    string    `json:"region"`
	City      string    `json:"city"`
	Latitude  float64   `json:"latitude"`
	Longitude float64   `json:"longitude"`
	Timestamp time.Time `json:"timestamp"`
}

GeoEntry defines data derived from browser info and ip address.

type IPStackConfig

type IPStackConfig struct {
	APIKey string
}

IPStackConfig ...

type MaxMindGeoLiteConfig

type MaxMindGeoLiteConfig struct {
	DBLocation string
}

MaxMindGeoLiteConfig ...

type Resolver

type Resolver interface {
	Init(options interface{}) error
	Close()
	Resolve(string) (*GeoEntry, error)
}

Resolver defines an IP-Geographic region resolver.

func NewGeoResolver

func NewGeoResolver(options interface{}) (Resolver, error)

NewGeoResolver creates a new GeoResolver. Note: this currently invokes the MaxMind Geo Resolver with the open-source GeoIP database

Jump to

Keyboard shortcuts

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