rucaptcha

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 13 Imported by: 1

README

rucaptcha-api

Go Reference Go Report Go Coverage CodeQL

Клиент для RuCaptcha.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient added in v1.0.0

func NewClient(params ClientParams) (*Client, error)

func (*Client) HTTPHandler

func (c *Client) HTTPHandler() http.Handler

func (*Client) Report

func (c *Client) Report(ctx context.Context, id string, ok bool) error

func (*Client) Solve

func (c *Client) Solve(ctx context.Context, in SolveIn) (*SolveOut, error)

type ClientParams added in v1.0.0

type ClientParams struct {
	Config Config      `validate:"required"`
	Clock  based.Clock `validate:"required_with=Config.Pingback"`

	Transport http.RoundTripper
}

type Config

type Config struct {
	Key      string `url:"key" validate:"required"`
	Pingback string `url:"pingback,omitempty"`
	SoftID   int    `url:"soft_id,omitempty"`
}

type Error

type Error struct {
	Code string
	Text string
}

func (Error) Error

func (e Error) Error() string

type SolveIn

type SolveIn interface {
	Method() string
}

type SolveOut

type SolveOut struct {
	ID     string
	Answer string
}

type YandexSmartCaptchaIn

type YandexSmartCaptchaIn struct {
	SiteKey                  string `url:"sitekey" validate:"required"`
	PageURL                  string `url:"pageurl" validate:"required"`
	AccessControlAllowOrigin bool   `url:"header_acao,omitempty"`
	UserAgent                string `url:"userAgent,omitempty"`
	Proxy                    string `url:"proxy,omitempty"`
	ProxyType                string `url:"proxytype,omitempty"`
}

func (*YandexSmartCaptchaIn) Method

func (in *YandexSmartCaptchaIn) Method() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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