Documentation ¶
Index ¶
- Constants
- Variables
- func GetError(text string) error
- func GetErrorBytes(text []byte) error
- type Client
- func (client *Client) GetBalance() (balance float64, err error)
- func (client *Client) GetStatus(captcha int) (ok bool, result string, err error)
- func (client *Client) GetURL(path string, v ...interface{}) string
- func (client *Client) Solve(image []byte) (result string, err error)
- func (client *Client) UploadImage(image []byte) (captcha int, err error)
- type LoadStat
Constants ¶
View Source
const (
// BaseURL - AntiGate base url.
BaseURL = "http://anti-captcha.com"
)
Variables ¶
View Source
var ( // ErrNoSlots - Error returned when API has no available workers. ErrNoSlots = errors.New("No slots available") // ErrCaptchaNotReady - Error returned when captcha is work in progress. ErrCaptchaNotReady = errors.New("Captcha is not yet solved") // ErrorNames - Errors by name returned from API. ErrorNames = map[string]error{ "ERROR_NO_SLOT_AVAILABLE": ErrNoSlots, "CAPCHA_NOT_READY": ErrCaptchaNotReady, } )
Functions ¶
func GetErrorBytes ¶
GetErrorBytes - Gets Antigate error by name.
Types ¶
type Client ¶
type Client struct { URL string Key string CheckInterval time.Duration // solve check interval RetryInterval time.Duration // retry interval when too much traffic MaxRetries int }
Client - AntiGate Client.
func New ¶
New - Creates new AntiGate client. Default values:
CheckInterval - 2.5 seconds RetryInterval - 2.5 seconds MaxRetries - 35
func (*Client) GetBalance ¶
GetBalance - Gets account balance.
type LoadStat ¶
type LoadStat struct { Waiting int `xml:"waiting"` WaitingRU int `xml:"waitingRU"` Load float32 `xml:"load"` Minbid float64 `xml:"minbid"` MinbidRU float64 `xml:"minbidRU"` AverageRecognitionTime float64 `xml:"averageRecognitionTime"` AverageRecognitionTimeRU float64 `xml:"averageRecognitionTimeRU"` }
LoadStat - AntiGate load statistics.
func GetSystemStat ¶
GetSystemStat - Gets AntiGate load statistics.
Click to show internal directories.
Click to hide internal directories.