captcha

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterSolver

func RegisterSolver(name string, constructor SolverConstructor)

Types

type Handler

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

func NewHandler

func NewHandler(solverProvider, apiKey string) (*Handler, error)

func (*Handler) HandleIfCaptcha

func (h *Handler) HandleIfCaptcha(ctx context.Context, page *rod.Page, pageHTML string) (bool, error)

type Info

type Info struct {
	Provider Provider
	SiteKey  string
	PageURL  string
	Action   string
}

func Identify

func Identify(page *rod.Page) (*Info, error)

type Provider

type Provider string
const (
	ProviderRecaptchaV2           Provider = "recaptchav2"
	ProviderRecaptchaV3           Provider = "recaptchav3"
	ProviderRecaptchaV2Enterprise Provider = "recaptchav2enterprise"
	ProviderRecaptchaV3Enterprise Provider = "recaptchav3enterprise"
	ProviderTurnstile             Provider = "turnstile"
	ProviderHCaptcha              Provider = "hcaptcha"
)

type Solution

type Solution struct {
	Token    string
	Provider Provider
}

type Solver

type Solver interface {
	Solve(ctx context.Context, info *Info) (*Solution, error)
}

func NewSolver

func NewSolver(provider, apiKey string) (Solver, error)

type SolverConstructor

type SolverConstructor func(apiKey string) (Solver, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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