recaptcha

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 8 Imported by: 0

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
}

Client implements Verifier for Google reCAPTCHA v2/v3 using the secret key.

func NewClient

func NewClient(secret string, timeout time.Duration) *Client

NewClient returns a verifier backed by Google's API. secret must be non-empty; timeout bounds a verification request.

func (*Client) Verify

func (c *Client) Verify(ctx context.Context, responseToken, remoteIP string) (bool, error)

Verify POSTs to siteverify and returns whether Google accepted the token.

type Verifier

type Verifier interface {
	Verify(ctx context.Context, responseToken, remoteIP string) (bool, error)
}

Verifier checks a user response token with Google's siteverify API.

Jump to

Keyboard shortcuts

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