geoip

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	Lookup(net.IP) (Info, error)
	Close() error
}

DB is a GeoIP database

type Info

type Info struct {
	Country string
	Region  string
	City    string
}

Info is a geographic information and other data associated with specific Internet protocol addresses

type MaxmindDB

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

MaxmindDB is a Maxmind GeoIP database

func OpenMaxmindDB

func OpenMaxmindDB(filePath string) (*MaxmindDB, error)

func (*MaxmindDB) Close

func (db *MaxmindDB) Close() error

func (*MaxmindDB) Lookup

func (db *MaxmindDB) Lookup(ip net.IP) (info Info, err error)

func (*MaxmindDB) LookupNetwork

func (db *MaxmindDB) LookupNetwork(ip net.IP) (connectionType string, err error)

Jump to

Keyboard shortcuts

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