maker

package
v0.0.0-...-47cd988 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INDEX_LEN       = 7
	REDIRECT_MODE_1 = 0x01
	REDIRECT_MODE_2 = 0x02
)

Variables

This section is empty.

Functions

func Ip2long

func Ip2long(IpStr string) (int64, error)

func IpInt642String

func IpInt642String(n int64) string

func IpLong2String

func IpLong2String(n int64) string

func IpString2Int64

func IpString2Int64(IpStr string) (int64, error)

func WriteIntLong

func WriteIntLong(b []byte, offset int, v int64)

Types

type DateBlock

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

func (*DateBlock) Bytes

func (dbl *DateBlock) Bytes() []byte

func (*DateBlock) String

func (dbl *DateBlock) String() string

type HeaderBlock

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

func (*HeaderBlock) Bytes

func (db *HeaderBlock) Bytes() []byte

type IndexBlock

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

type IpInfo

type IpInfo struct {
	Ip      string
	Country string
	City    string
}

func (*IpInfo) String

func (ip *IpInfo) String() string

type Maker

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

func NewMaker

func NewMaker(dbFilePath string, md []Metadata, rm, pm, im map[string]int) *Maker

type Metadata

type Metadata struct {
	StartIP  string
	EndIP    string
	Country  string
	Province string
	City     string
	Isp      string
}

func MergeMetadata

func MergeMetadata(n, m []Metadata) []Metadata

weight of m more then n

func (*Metadata) Format

func (md *Metadata) Format()

func (*Metadata) RegionString

func (md *Metadata) RegionString() string

func (*Metadata) String

func (md *Metadata) String() string

type QQwry

type QQwry struct {
	Ip      string
	Country string
	City    string
	// contains filtered or unexported fields
}

func NewQQwry

func NewQQwry(file string) (qqwry *QQwry)

func (*QQwry) Find

func (qw *QQwry) Find(ip string)

func (*QQwry) GetQQWryIpRecord

func (qw *QQwry) GetQQWryIpRecord(pm map[string]int) ([]Metadata, error)

func (*QQwry) Iterate

func (qw *QQwry) Iterate(ch chan IpInfo)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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