mirror of https://github.com/mpolden/echoip
Added extra IP Stack fields
- IsDaylightSavings - IsProxy - IsTOR - IsCrawler - CrawlerName - CrawlerType - ThreatLevel - ThreatTypes
This commit is contained in:
parent
09a47bea6a
commit
81aa484762
|
@ -136,6 +136,11 @@
|
||||||
<th scope="row">Timezone</th>
|
<th scope="row">Timezone</th>
|
||||||
<td>{{ .Timezone }}</td>
|
<td>{{ .Timezone }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{{ end }} {{ if .IsDayLightSavings }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Is Daylight Savings?</th>
|
||||||
|
<td>{{ .IsDayLightSavings }}</td>
|
||||||
|
</tr>
|
||||||
{{ end }} {{ if .ASN }}
|
{{ end }} {{ if .ASN }}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">ASN</th>
|
<th scope="row">ASN</th>
|
||||||
|
@ -166,7 +171,52 @@
|
||||||
<th scope="row">User agent: Raw</th>
|
<th scope="row">User agent: Raw</th>
|
||||||
<td>{{ .UserAgent.RawValue }}</td>
|
<td>{{ .UserAgent.RawValue }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{ end }} {{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .IsProxy }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Is Proxy?</th>
|
||||||
|
<td>{{ .IsProxy }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .IsCrawler }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Is Crawler?</th>
|
||||||
|
<td>{{ .IsCrawler }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Crawler Name</th>
|
||||||
|
<td>{{ .CrawlerName }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Crawler Type</th>
|
||||||
|
<td>{{ .CrawlerType }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .IsTor }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Is Tor?</th>
|
||||||
|
<td>{{ .IsTor }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .ThreatLevel }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Threat Level</th>
|
||||||
|
<td>{{ .ThreatLevel }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ if .ThreatTypes }}
|
||||||
|
<tr>
|
||||||
|
<th scope="row">Threat Types</th>
|
||||||
|
<td>{{ .ThreatTypes }}</td>
|
||||||
|
</tr>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ end }}
|
||||||
</table>
|
</table>
|
||||||
{{ if .Country }} {{ if .UsingGeoIP }}
|
{{ if .Country }} {{ if .UsingGeoIP }}
|
||||||
<p>
|
<p>
|
||||||
|
|
|
@ -41,6 +41,17 @@ func (ips *IPStack) Parse(ip net.IP, hostname string) (parser.Response, error) {
|
||||||
|
|
||||||
if res.Timezone != nil {
|
if res.Timezone != nil {
|
||||||
parserResponse.Timezone = res.Timezone.ID
|
parserResponse.Timezone = res.Timezone.ID
|
||||||
|
parserResponse.IsDayLightSavings = res.Timezone.IsDaylightSaving
|
||||||
|
}
|
||||||
|
|
||||||
|
if res.Security != nil {
|
||||||
|
parserResponse.IsProxy = res.Security.IsProxy
|
||||||
|
parserResponse.IsCrawler = res.Security.IsCrawler
|
||||||
|
parserResponse.CrawlerName = res.Security.CrawlerName
|
||||||
|
parserResponse.CrawlerType = res.Security.CrawlerType
|
||||||
|
parserResponse.IsTor = res.Security.IsTOR
|
||||||
|
parserResponse.ThreatLevel = res.Security.ThreatLevel
|
||||||
|
parserResponse.ThreatTypes = &res.Security.ThreatTypes
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.Location != nil {
|
if res.Location != nil {
|
||||||
|
|
|
@ -13,23 +13,32 @@ type Parser interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Response struct {
|
type Response struct {
|
||||||
UsingGeoIP bool `json:"UsingGeoIP"`
|
UsingGeoIP bool `json:"UsingGeoIP"`
|
||||||
UsingIPStack bool `json:"UsingIPStack"`
|
UsingIPStack bool `json:"UsingIPStack"`
|
||||||
IP net.IP `json:"ip"`
|
IP net.IP `json:"ip"`
|
||||||
IPDecimal *big.Int `json:"ip_decimal"`
|
IPDecimal *big.Int `json:"ip_decimal"`
|
||||||
Country string `json:"country,omitempty"`
|
Country string `json:"country,omitempty"`
|
||||||
CountryISO string `json:"country_iso,omitempty"`
|
CountryISO string `json:"country_iso,omitempty"`
|
||||||
CountryEU *bool `json:"country_eu,omitempty"`
|
CountryEU *bool `json:"country_eu,omitempty"`
|
||||||
RegionName string `json:"region_name,omitempty"`
|
RegionName string `json:"region_name,omitempty"`
|
||||||
RegionCode string `json:"region_code,omitempty"`
|
RegionCode string `json:"region_code,omitempty"`
|
||||||
MetroCode uint `json:"metro_code,omitempty"`
|
MetroCode uint `json:"metro_code,omitempty"`
|
||||||
PostalCode string `json:"zip_code,omitempty"`
|
PostalCode string `json:"zip_code,omitempty"`
|
||||||
City string `json:"city,omitempty"`
|
City string `json:"city,omitempty"`
|
||||||
Latitude float64 `json:"latitude,omitempty"`
|
Latitude float64 `json:"latitude,omitempty"`
|
||||||
Longitude float64 `json:"longitude,omitempty"`
|
Longitude float64 `json:"longitude,omitempty"`
|
||||||
Timezone string `json:"time_zone,omitempty"`
|
Timezone string `json:"time_zone,omitempty"`
|
||||||
ASN string `json:"asn,omitempty"`
|
IsDayLightSavings bool `json:"is_daylight_savings,omitempty"`
|
||||||
ASNOrg string `json:"asn_org,omitempty"`
|
ASN string `json:"asn,omitempty"`
|
||||||
Hostname string `json:"hostname,omitempty"`
|
ASNOrg string `json:"asn_org,omitempty"`
|
||||||
UserAgent *useragent.UserAgent `json:"user_agent,omitempty"`
|
Hostname string `json:"hostname,omitempty"`
|
||||||
|
UserAgent *useragent.UserAgent `json:"user_agent,omitempty"`
|
||||||
|
CurrencyCode string `json:"currency_code,omitempty"`
|
||||||
|
IsProxy bool `json:"is_proxy,omitempty"`
|
||||||
|
IsCrawler bool `json:"is_crawler,omitempty"`
|
||||||
|
CrawlerName string `json:"crawler_name,omitempty"`
|
||||||
|
CrawlerType string `json:"crawler_type,omitempty"`
|
||||||
|
IsTor bool `json:"is_tor,omitempty"`
|
||||||
|
ThreatLevel string `json:"threat_level,omitempty"`
|
||||||
|
ThreatTypes *interface{} `json:"threat_types,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue