Documentation ¶
Overview ¶
Package ipfsgeoip provides geoip information lookup using an IPFS-hosted GeoLite2 database. The database is split to allow efficient lookups and it does not need to be fully downloaded for every lookup.
This package is a fork of ipfs-geoip (Javascript).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeoIPInfo ¶
type GeoIPInfo struct { CountryName string CountryCode string RegionCode string City string PostalCode string Latitude float64 Longitude float64 }
GeoIPInfo provides geographical information about an IP address.
func (*GeoIPInfo) UnmarshalJSON ¶
UnmarshalJSON decodes geoip-information objects as they are stored in the database.
type IPLocator ¶
type IPLocator struct {
// contains filtered or unexported fields
}
IPLocator obtains geo information for IP addresses by using a GeoLite2 database hosted on IPFS.
func NewIPLocator ¶
func NewIPLocator(ng format.NodeGetter) *IPLocator
NewIPLocator returns an IPLocator that uses the given NodeGetter.
Click to show internal directories.
Click to hide internal directories.