wry

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	// RedirectMode1 [IP][0x01][国家和地区信息的绝对偏移地址]
	RedirectMode1 = 0x01
	// RedirectMode2 [IP][0x02][信息的绝对偏移][...] or [IP][国家][...]
	RedirectMode2 = 0x02
)

Variables

This section is empty.

Functions

func Bytes3ToUint32

func Bytes3ToUint32(data []byte) uint32

Types

type IPDB

type IPDB[T ~uint32 | ~uint64] struct {
	Data []byte

	OffLen   uint8
	IPLen    uint8
	IPCnt    T
	IdxStart T
	IdxEnd   T
}

IPDB common ip database

func (*IPDB[uint32]) SearchIndexV4

func (db *IPDB[uint32]) SearchIndexV4(ip uint32) uint32

func (*IPDB[uint64]) SearchIndexV6

func (db *IPDB[uint64]) SearchIndexV6(ip uint64) uint32

type Reader

type Reader struct {
	Result Result
	// contains filtered or unexported fields
}

func NewReader

func NewReader(data []byte) Reader

func (*Reader) Parse

func (r *Reader) Parse(offset uint32)

type Result

type Result struct {
	Country string `json:"country"`
	Area    string `json:"area"`
}

func (*Result) DecodeGBK

func (r *Result) DecodeGBK() *Result

func (Result) String

func (r Result) String() string

func (*Result) Trim

func (r *Result) Trim() *Result

Jump to

Keyboard shortcuts

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