digitalelement

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package digitalelement is written to de data written in a MMDB file the MMDB file contain the country,region and city code for particular ip ranges and then we get the corresponding name of country with the help of data map initialized when connecting to the database

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close method will close the digitalelement db files

func Connect

func Connect(df *DataFiles)

Connect method will open a connection to the database which will only be closed

Types

type DataFiles

type DataFiles struct {
	V4Database  string
	V6Database  string
	CountryCode string
	RegionCode  string
	CityCode    string

	CountryCorrection string
	CityCorrection    string
}

DataFiles struct contains the path to all the files which are required to connect to the digitalelement database and get the data in the desired format

type Record

type Record struct {
	Country, Region, City string
	Lat, Long             float64
}

Record struct contains all the information regarding IP which digitalelement database can provide

func Lookup

func Lookup(ip string) Record

Lookup method will return the information about any given ip address

Jump to

Keyboard shortcuts

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