netx

package
v0.0.0-...-5f1e29e Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

from https://github.com/freshcn/qqwry

Index

Constants

View Source
const (
	INDEX_LEN       = 7    // INDEX_LEN 索引长度
	REDIRECT_MODE_1 = 0x01 // REDIRECT_MODE_1 国家的类型, 指向另一个指向
	REDIRECT_MODE_2 = 0x02 // REDIRECT_MODE_2 国家的类型, 指向一个指向
)

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(str string) (string, error)

base64 decode

func Base64Encode

func Base64Encode(str string) string

base64 encode

func ExternalIP

func ExternalIP() (net.IP, error)

func GetIpIn

func GetIpIn() string

获取内网IP

func GetIpOut

func GetIpOut() string

获取外网IP

func GetKey

func GetKey() (uint32, error)

func UrlDecode

func UrlDecode(str string) (string, error)

url decode string

func UrlEncode

func UrlEncode(str string) string

url encode string, is + not %20

Types

type QQwry

type QQwry struct {
	Ip      string
	Lng     float64
	Lat     float64
	Address string
	Ips     string

	FileData []byte
	NumIp    int64
	Offset   int64
	Enc      mahonia.Decoder
	// contains filtered or unexported fields
}

func NewQQwry

func NewQQwry(path_file string) (qqwry *QQwry)

func (*QQwry) Find

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

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 设置偏移量

Jump to

Keyboard shortcuts

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