geoip

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoData

type GeoData struct {
	IsoCode     string  // Country ISO-3166 code
	CountryName string  // The full country name.
	Continent   string  // The two character continent that the country is located. EX: EU
	Region      string  // The two character region. For US, this is state. For Canada, providence, for Chile this is a region, etc.
	City        string  // The city name if supported by the database.
	PostalCode  string  // The postal code if supported by the database.
	Latitude    float64 // The latitude if supported by the database.
	Longitude   float64 // The longitude if supported by the database.
}

type GeoDb

type GeoDb interface {
	Init(parameters map[string]string) error
	Get(address string) (GeoData, error)
	Close() error
}

type Ip2Location

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

func (*Ip2Location) Close

func (i2l *Ip2Location) Close() error

func (*Ip2Location) Get

func (i2l *Ip2Location) Get(address string) (GeoData, error)

func (*Ip2Location) Init

func (i2l *Ip2Location) Init(args map[string]string) error

type Maxminddb

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

func (*Maxminddb) Close

func (mx *Maxminddb) Close() error

func (*Maxminddb) Get

func (mx *Maxminddb) Get(address string) (GeoData, error)

func (*Maxminddb) Init

func (mx *Maxminddb) Init(args map[string]string) error

Jump to

Keyboard shortcuts

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