custom

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IndexLen 索引长度
	IndexLen = 7
	// RedirectMode1 国家的类型, 指向另一个指向
	RedirectMode1 = 0x01
	// RedirectMode2 国家的类型, 指向一个指向
	RedirectMode2 = 0x02
)
View Source
const UnknownService = "unknown"

Variables

View Source
var IPData fileData

IPData IP库的数据

Functions

func CheckFile

func CheckFile(data []byte) bool

func GetOnline

func GetOnline() ([]byte, error)

Types

type CDNCheck

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

func NewCDNCheck

func NewCDNCheck() *CDNCheck

NewCDNCheck 创建CDNCheck对象

func (*CDNCheck) Check

func (c *CDNCheck) Check(domain string) (isCDN bool, CDNName string, CName string)

func (*CDNCheck) CheckASN

func (c *CDNCheck) CheckASN(ip string) (isCDN bool)

CheckASN 检查IP的ASN判断是否是CDN

func (*CDNCheck) CheckCName

func (c *CDNCheck) CheckCName(domain string) (isCDN bool, CDNName string, CName string)

CheckCName 检查域名的CNAME,判断是否是CDN

func (*CDNCheck) CheckIP

func (c *CDNCheck) CheckIP(ip string) (isCDN bool)

CheckIP 检查IP是否为CDN

func (*CDNCheck) CloseGeoASNDb

func (c *CDNCheck) CloseGeoASNDb()

func (*CDNCheck) LoadGeoASNDb

func (c *CDNCheck) LoadGeoASNDb() error

type Ipv4Location

type Ipv4Location struct {

	// 用于自定义IP归属地库
	WorkspaceId string
	// contains filtered or unexported fields
}

func NewIPv4Location

func NewIPv4Location(workspaceId string) *Ipv4Location

NewIPv4Location 创建iplocation对象

func (*Ipv4Location) Find

func (ipl *Ipv4Location) Find(ip string) string

Find 查询IP归属地,先查询自定义IP归属地库,再查询公网的纯真IP数据库

func (*Ipv4Location) FindCustomIP

func (ipl *Ipv4Location) FindCustomIP(ip string) string

FindCustomIP 查询自定义IP归属地

func (*Ipv4Location) FindPublicIP

func (ipl *Ipv4Location) FindPublicIP(ip string) string

FindPublicIP 查询纯真数据库获取公网IP归属地

type Ipv6Location

type Ipv6Location struct {
	wry.IPDB[uint64]
}

func NewIPv6Location

func NewIPv6Location() (*Ipv6Location, error)

func (*Ipv6Location) Find

func (db *Ipv6Location) Find(query string) string

func (*Ipv6Location) FindByZX

func (db *Ipv6Location) FindByZX(query string, _ ...string) (result *wry.Result, err error)

type QQwry

type QQwry struct {
	Data   *fileData
	Offset int64
}

QQwry 纯真ip库

func NewQQwry

func NewQQwry() QQwry

NewQQwry 新建 qqwry 类型

func (*QQwry) Find

func (q *QQwry) Find(ip string) (res ResultQQwry)

Find ip地址查询对应归属地信息

func (*QQwry) ReadData

func (q *QQwry) ReadData(num int, offset ...int64) (rs []byte)

ReadData 从文件中读取数据

func (*QQwry) SetOffset

func (q *QQwry) SetOffset(offset int64)

SetOffset 设置偏移量

type Response

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

Response 向客户端返回数据的

type ResultQQwry

type ResultQQwry struct {
	IP      string `json:"ip"`
	Country string `json:"country"`
	Area    string `json:"area"`
}

ResultQQwry 归属地信息

type Service

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

func NewService

func NewService() Service

NewService 创建service对象

func (*Service) FindService

func (s *Service) FindService(portNumber int) string

FindService 查找端口服务 否则从nmap定义的服务类型中进行查找

Jump to

Keyboard shortcuts

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