geoip2

package
v0.0.0-...-6036a1a Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeoService

type GeoService struct {

	// Filename of the MaxMind city database ("GeoIP2-City.mmdb").
	Path string
	// contains filtered or unexported fields
}

GeoService is a service for looking up geolocation by IP address using a MaxMind database.

https://dev.maxmind.com/geoip/geoip2/geolite2/

func (*GeoService) Close

func (s *GeoService) Close() error

Close closes the internal reader, if set.

func (*GeoService) GeoByIP

func (s *GeoService) GeoByIP(ctx context.Context, ip string) (*netstats.Geo, error)

GeoByIP returns geolocation information by IP address.

func (*GeoService) Open

func (s *GeoService) Open() (err error)

Open initializes the internal reader with the service's file path.

Jump to

Keyboard shortcuts

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