ipdb

package module
v0.0.0-...-34e06a1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2017 License: MIT Imports: 7 Imported by: 1

README

go-ipdb

find ip location

Documentation

Index

Constants

View Source
const METALEN = 20

Variables

This section is empty.

Functions

func IP2long

func IP2long(ipv4 string) (ret uint32, err error)

func Long2Ip

func Long2Ip(a uint32) net.IP

Types

type DB

type DB struct {
	Head                                        Header
	Continent, Country, Area, Region, City, Isp map[uint16]string
	Idx                                         map[int]uint32
	Rstart                                      int
	Data                                        []byte
}

DB struct

func Load

func Load(dataFile string) (db *DB, err error)

func (*DB) Find

func (db *DB) Find(ipv4 string) (result *Result, err error)

func (*DB) FindByUint

func (db *DB) FindByUint(ip uint32) (result *Result, err error)

func (*DB) Init

func (db *DB) Init(data []byte)

type Hdata

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

Hdata struct

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

Header struct

type Record

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

Record struct

type Result

type Result struct {
	Cidr, Continent, Country, Area, Region, City, Isp string
}

Result structs

Jump to

Keyboard shortcuts

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