Documentation
¶
Index ¶
- func VerifyWebhookSignature(rawBody []byte, sigHeader, secret string) bool
- type AIBotDetail
- type Client
- func (c *Client) BulkLookup(ctx context.Context, ips []string, userAgent string) ([]LookupResult, error)
- func (c *Client) GuardMiddleware(minBlockScore int, next http.Handler) http.Handler
- func (c *Client) Lookup(ctx context.Context, ip, userAgent string) (*LookupResult, error)
- func (c *Client) LookupAIBot(ctx context.Context, slug string) (*AIBotDetail, error)
- func (c *Client) LookupCountry(ctx context.Context, countryCode string) (*CountrySummary, error)
- type CountrySummary
- type LookupResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyWebhookSignature ¶
Types ¶
type AIBotDetail ¶
type AIBotDetail struct {
ID string `json:"id"`
Slug string `json:"slug"`
Name string `json:"name"`
Owner string `json:"owner"`
Category string `json:"category"`
RobotsToken string `json:"robots_token"`
VerificationMode string `json:"verification_mode"`
IPv4Prefixes []string `json:"ipv4_prefixes"`
IPv6Prefixes []string `json:"ipv6_prefixes"`
TotalIPv4 uint64 `json:"total_ipv4"`
DBVersion string `json:"db_version"`
}
type Client ¶
func (*Client) BulkLookup ¶
func (*Client) GuardMiddleware ¶
GuardMiddleware blocks spoofed AI bots and requests at or above minBlockScore (fail-open on network errors).
func (*Client) LookupAIBot ¶
func (*Client) LookupCountry ¶
type CountrySummary ¶
type CountrySummary struct {
Country string `json:"country"`
TotalASNs int `json:"total_asns"`
TotalIPv4 uint64 `json:"total_ipv4"`
TotalIPv6Prefixes uint64 `json:"total_ipv6_prefixes"`
AvgRiskBaseline int `json:"avg_risk_baseline"`
TypeCounts map[string]int `json:"type_counts"`
TypeIPv4 map[string]uint64 `json:"type_ipv4"`
DBVersion string `json:"db_version"`
}
type LookupResult ¶
type LookupResult struct {
IP string `json:"ip"`
Hostname string `json:"hostname,omitempty"`
Geo struct {
Country string `json:"country"`
Region string `json:"region"`
City string `json:"city"`
Postal string `json:"postal,omitempty"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
Timezone string `json:"timezone"`
} `json:"geo"`
Network struct {
ASN string `json:"asn"`
ASNNum uint32 `json:"asn_num"`
Org string `json:"org"`
Domain string `json:"domain,omitempty"`
CIDR string `json:"cidr,omitempty"`
Type string `json:"type"`
Provider string `json:"provider,omitempty"`
} `json:"network"`
Flags struct {
IsDatacenter bool `json:"is_datacenter"`
IsMobile bool `json:"is_mobile"`
IsProxy bool `json:"is_proxy"`
IsVPN bool `json:"is_vpn"`
IsTor bool `json:"is_tor"`
IsResidentialProxy bool `json:"is_residential_proxy"`
IsAbuser bool `json:"is_abuser"`
IsAIBot bool `json:"is_ai_bot"`
IsSpoofedBot bool `json:"is_spoofed_bot"`
} `json:"flags"`
Bot *struct {
Name string `json:"name"`
Owner string `json:"owner"`
Category string `json:"category"`
Verified bool `json:"verified"`
ClaimedName string `json:"claimed_name,omitempty"`
} `json:"bot,omitempty"`
Risk struct {
Score int `json:"score"`
Level string `json:"level"`
Recommendation string `json:"recommendation"`
Reasons []string `json:"reasons"`
} `json:"risk"`
}
Click to show internal directories.
Click to hide internal directories.