dbtools

package
v0.0.0-...-204a80d Latest Latest
Warning

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

Go to latest
Published: May 13, 2023 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Before_Hop_Type = 0
	Next_Hop_Type   = 1
)

Variables

This section is empty.

Functions

func AddASNData

func AddASNData(data *ipgeo.IPGeoData) error

func AddData

func AddData(c *CityInfo)

func AddGeo

func AddGeo(g *Geo)

func AddHistory

func AddHistory(data *ipgeo.IPGeoData, uid int) error

func AddIP

func AddIP(data *ipgeo.IPGeoData, uid int) error

func AddIPScense

func AddIPScense(data *ipgeo.IPGeoData, scene string) error

func AddIPWhois

func AddIPWhois(data *ipgeo.IpWhois) error

func AddIPv6

func AddIPv6(data *ipgeo.IPGeoData, uid int) error

func AddRouter

func AddRouter(ip string, prefix string, data map[string][]string)

func AddUsers

func AddUsers(ip string) (int, error)

func CountryCodeToCountryName

func CountryCodeToCountryName(country_code string) string

func FindNeiborHop

func FindNeiborHop(ip string) (string, error)

func GetDB

func GetDB() *gorm.DB

func GetIATAGeo

func GetIATAGeo(ptr string) (*ipgeo.IPGeoData, error)

func InetAtoN

func InetAtoN(ip string) int64

func InetNtoA

func InetNtoA(ip uint64) string

func IsChinese

func IsChinese(str string) bool

func ParseIPRange

func ParseIPRange(inet string) (int64, int64)

func SearchUsers

func SearchUsers(ip string) (int, error)

func ShowAllCities

func ShowAllCities() *[]Cache

func UpdateIP

func UpdateIP(ip string, prefix int, asnumber string, country string, prov string, city string, district string) error

func UpdateIPv6

func UpdateIPv6(ip string, prefix int, asnumber string, country string, prov string, city string, district string) error

Types

type Asn

type Asn struct {
	Asn     int
	Alias   string
	Isp     string
	Website string
}

func SearchASNData

func SearchASNData(asnNumber string) (*Asn, error)

type Cache

type Cache struct {
	Id       uint
	Uid      uint
	Ip       string
	Prefix   int
	Asnumber string
	Country  string
	Prov     string
	City     string
	District string
	Owner    string
	Isp      string
}

func SearchIP

func SearchIP(ip string) (*Cache, error)

type Cache_scense

type Cache_scense struct {
	Id     uint
	Ip     string
	Scense string
}

func SearchIPScense

func SearchIPScense(ip string) (*Cache_scense, error)

type Cache_v6

type Cache_v6 struct {
	Id       uint
	Uid      uint
	Ip       string
	Prefix   int
	Asnumber string
	Country  string
	Prov     string
	City     string
	District string
	Owner    string
	Isp      string
}

func SearchIPv6

func SearchIPv6(ip string) (*Cache_v6, error)

type CityInfo

type CityInfo struct {
	CountryZH          string
	CountryEN          string
	RegionZH           string
	RegionEN           string
	CityZH             string
	CityEN             string
	CenterLocationLat  float64
	CenterLocationLng  float64
	BoundsNortheastLat float64
	BoundsNortheastLng float64
	BoundsSouthwestLat float64
	BoundsSouthwestLng float64
}

func GetInfoData

func GetInfoData(g *Geo) (*CityInfo, error)

func SearchData

func SearchData(r *ipgeo.IPGeoData) CityInfo

type Geo

type Geo struct {
	Country string
	Prov    string
	City    string
	Lat     float64
	Lon     float64
}

type History_information

type History_information struct {
	Id          uint
	Uid         uint
	Ip          string
	Asnumber    string
	Country     string
	Prov        string
	City        string
	District    string
	Owner       string
	Isp         string
	Domain      string
	RequestDate time.Time
}

type Hop

type Hop struct {
	Address *ipgeo.IPGeoData `json:"address"`
	Count   uint             `json:"count"`
}

type Iata_code

type Iata_code struct {
	Code           string
	Country        string
	Province       string
	City           string
	Isp_city_en    string
	Isp_city_4_ntt string
	Country_code   string
	Province_code  string
	Province_en    string
}

type Ip_whois

type Ip_whois struct {
	Id           uint
	Begin        int64
	End          int64
	Netname      string
	Owner        string
	Country_code string
}

func SearchIPWhois

func SearchIPWhois(ip string) (*Ip_whois, error)

type Ipv4_asn

type Ipv4_asn struct {
	Asn    int
	Org    string
	Isp    string
	Domain string
}

func SearchASNData

func SearchASNData(asnNumber string) (*Ipv4_asn, error)

type Result

type Result struct {
	BeforeHop map[string]*Hop
	NextHop   map[string]*Hop
}

type Router

type Router struct {
	Id           int
	Ip           string
	Ipend        string
	Prefix       string
	Asnumber     string
	Fromasnumber string
}

func SearchRouter

func SearchRouter(ip string) []Router

type Users

type Users struct {
	Uid int
	Ip  string
}

Jump to

Keyboard shortcuts

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