Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ModuleName string = "PEER-LOCALIZER" Log = logrus.WithField( "module", ModuleName, ) TooManyRequestError = "error HTTP 429" )
Functions ¶
This section is empty.
Types ¶
type IpApiMessage ¶
type IpApiMessage struct { Query string `json:"query"` Status string `json:"status"` Country string `json:"country"` CountryCode string `json:"countryCode"` Region string `json:"region"` RegionName string `json:"regionName"` City string `json:"city"` Zip string `json:"zip"` Lat float64 `json:"lat"` Lon float64 `json:"lon"` Timezone string `json:"timezone"` Isp string `json:"isp"` Org string `json:"org"` As string `json:"as"` }
IP-API message structure
type PeerLocalizer ¶
type PeerLocalizer struct {
// contains filtered or unexported fields
}
func NewPeerLocalizer ¶
func NewPeerLocalizer(ctx context.Context, cacheSize int) PeerLocalizer
func (*PeerLocalizer) Close ¶
func (c *PeerLocalizer) Close()
func (*PeerLocalizer) LocateIP ¶
func (c *PeerLocalizer) LocateIP(ip string) (IpApiMessage, error)
LocateIP is an externa request that any module could do to identify an IP
func (*PeerLocalizer) Run ¶
func (c *PeerLocalizer) Run()
Run the necessary routines to locate the IPs
Click to show internal directories.
Click to hide internal directories.