geoip

package
v0.0.0-...-efaec8f Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DOWNLOAD_GEOIP2_URL = "https://raw.githubusercontent.com/Hackl0us/GeoIP2-CN/release/Country.mmdb"
View Source
const GEOIP2_PATH = "geoip.mmdb"

Variables

This section is empty.

Functions

func Close

func Close()

func FileExists

func FileExists(filename string) bool

func InPRC

func InPRC(addr string) bool

func Load

func Load() (err error)

func Update

func Update() (err error)

Types

type DNSCache

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

DNSCache

func NewDNSCache

func NewDNSCache() *DNSCache

初始化DNS缓存

func (*DNSCache) Query

func (cache *DNSCache) Query(domain string) (ip net.IP, ok bool)

查询并保存DNS缓存

Jump to

Keyboard shortcuts

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