ipintel

package module
v0.0.0-...-295148d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2016 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

go-ipintel

DUB

Simple Go wrapper for getipintel.net - a free service that determines how likely an IP address is a proxy or VPN exit node using both static block lists and machine learning.

Documentation

Overview

Package ipintel is a simple Go wrapper for the getipintel.net proxy detection API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckType

type CheckType string

CheckType represents the type of check used to determine the proxy score.

const (
	// Static uses static lists to determine if the IP is a proxy.
	// The returned score is either 0 or 1.
	Static CheckType = "m"
	// Dynamic uses static lists and machine learning to determine if the IP is
	// a proxy. The returned score is a floating number between 0 and 1.
	Dynamic CheckType = "b"
)

type Client

type Client struct {
	// Your email address
	Email string
	// Scheme used for the API requests ("http" or "https")
	Scheme string
	// Type of proxy check to use (Static/Dynamic)
	Check CheckType
	// Maximum time to wait when a query is being throttled.
	// If set to zero calls to GetProxyScore() will block until
	// there is enough capacity in the rate limiter bucket.
	MaxWait time.Duration
}

Client is a struct used to make API queries.

func NewClient

func NewClient(email string, ssl bool, check CheckType, mWait time.Duration) *Client

NewClient creates a new Client using the given parameters. Example:

c := ipintel.NewClient("your@email.com", false, ipintel.Static, 5*time.Second)

func (*Client) GetProxyScore

func (c *Client) GetProxyScore(ip string) (score float32, err error)

GetProxyScore queries the API and returns the proxy score for the given IP address.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址