maxmind

package
v3.3.5+incompatible Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 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 MaxMind

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

MaxMind contains a pointer to a reader

func New

func New(filename string) (MaxMind, error)

New creates a new maxMind reader.

func (MaxMind) Close

func (mm MaxMind) Close() error

Close closes the maxMind connection

func (MaxMind) LookupIP

func (mm MaxMind) LookupIP(ipStr string) (Record, error)

LookupIP returns geo information about an IP

type Record

type Record struct {
	Location struct {
		Latitude  float32 `maxminddb:"latitude"`
		Longitude float32 `maxminddb:"longitude"`
	} `maxminddb:"location"`
}

Record contains the information we want out of maxMind

Jump to

Keyboard shortcuts

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