Documentation ¶
Index ¶
- Constants
- Variables
- func GetCurrentEpoch(ctx context.Context) (int64, error)
- func GetGeocodeClient() (*maps.Client, error)
- func LoadIPsBaidu(filepath string) (map[string]IPsBaiduRecord, error)
- func LoadIPsGeolite2(filepath string) (map[string]IPsGeolite2Record, error)
- type Address
- type BaiduDetail
- type FinalGeoData
- type GeoData
- type GeoIPCheck
- type Geolite2Detail
- type IPInfoResolver
- type IPInfoResponse
- type IPsBaiduRecord
- type IPsBaiduReport
- type IPsGeolite2Record
- type IPsGeolite2Report
- type MinerData
- type MultiaddrsIPsRecord
- type MultiaddrsIPsReport
Constants ¶
View Source
const MAX_DISTANCE = 600
Variables ¶
View Source
var CountryToContinentJSON []byte
Functions ¶
func GetCurrentEpoch ¶
GetCurrentEpoch gets the current chain height from the Lotus API
func GetGeocodeClient ¶
func LoadIPsBaidu ¶
func LoadIPsBaidu(filepath string) (map[string]IPsBaiduRecord, error)
func LoadIPsGeolite2 ¶
func LoadIPsGeolite2(filepath string) (map[string]IPsGeolite2Record, error)
Types ¶
type BaiduDetail ¶
type BaiduDetail map[string]interface{}
type FinalGeoData ¶
type GeoData ¶
type GeoData struct { MultiaddrsIPs []MultiaddrsIPsRecord Ipinfo *IPInfoResolver IPsGeolite2 map[string]IPsGeolite2Record IPsBaidu map[string]IPsBaiduRecord IPsGeoIP2 map[string]geoip2.Response }
func LoadGeoData ¶
type GeoIPCheck ¶
type GeoIPCheck struct{}
func (*GeoIPCheck) DoCheck ¶
func (*GeoIPCheck) DoCheck(ctx context.Context, miner MinerData) (checks.NormalizedLocation, error)
type Geolite2Detail ¶
type Geolite2Detail map[string]interface{}
type IPInfoResolver ¶
func NewIPInfoResolver ¶
func NewIPInfoResolver() (*IPInfoResolver, error)
func (*IPInfoResolver) ResolveIP ¶
func (i *IPInfoResolver) ResolveIP(ctx context.Context, ip net.IP) (map[string]IPInfoResponse, error)
func (*IPInfoResolver) ResolveIPStr ¶
type IPInfoResponse ¶
type IPInfoResponse struct { IP string `json:"ip"` Hostname string `json:"hostname"` City string `json:"city"` Region string `json:"region"` Country string `json:"country"` Location string `json:"loc"` Org string `json:"org"` Postal string `json:"postal"` Timezone string `json:"timezone"` ASN struct { ASN string `json:"asn"` Name string `json:"name"` Domain string `json:"domain"` Route string `json:"route"` Type string `json:"type"` } `json:"asn"` }
type IPsBaiduRecord ¶
type IPsBaiduReport ¶
type IPsBaiduReport struct { Date *string `json:"date"` IPs map[string]IPsBaiduRecord `json:"ipsBaidu"` }
type IPsGeolite2Record ¶
type IPsGeolite2Report ¶
type IPsGeolite2Report struct { Date *string `json:"date"` IPs map[string]IPsGeolite2Record `json:"ipsGeolite2"` }
type MultiaddrsIPsRecord ¶
type MultiaddrsIPsRecord struct { Miner string `json:"miner"` Maddr string `json:"maddr"` PeerID string `json:"peerId"` IP string `json:"ip"` Epoch uint `json:"epoch"` Timestamp string `json:"timestamp"` DHT bool `json:"dht"` Chain bool `json:"chain"` }
func LoadMultiAddrsIPs ¶
func LoadMultiAddrsIPs(filepath string) ([]MultiaddrsIPsRecord, error)
type MultiaddrsIPsReport ¶
type MultiaddrsIPsReport struct { Date *string MultiaddrsIPs []MultiaddrsIPsRecord }
Click to show internal directories.
Click to hide internal directories.