lookup

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PRIVATE_IP = `10.0.0.0 10.255.255.255
172.16.0.0 172.31.255.255
192.168.0.0 192.168.255.255`
)

Variables

View Source
var (
	CHN_IP = `` /* 211955-byte string literal not displayed */

)
View Source
var IPv4LookupTable [][]uint32
View Source
var IPv4PrivateLookupTable [][]uint32

Functions

func IPAddressToInteger

func IPAddressToInteger(ip string) int

func IPInLookupTable

func IPInLookupTable(ip string, table [][]uint32) bool

func IsChineseIP

func IsChineseIP(ip string) bool

func IsChineseWebsite

func IsChineseWebsite(host string) bool

Exceptions are those Chinese websites who have oversea servers or CDNs, if you lookup their IPs outside China, you get foreign IPs based on your VPS's geolocation, which are of course undesired results. Using white list to filter these exceptions

func IsPrivateIP

func IsPrivateIP(ip string) bool

func LoadOrCreateChinaList

func LoadOrCreateChinaList()

func LookupIP

func LookupIP(host string) string

func LookupIPInt

func LookupIPInt(host string) int

Types

type China_list_t

type China_list_t map[string]interface{}
var ChinaList China_list_t

Jump to

Keyboard shortcuts

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