Help us shape the future of Go! Take the 2026 Go Developer Survey

challenge

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package challenge verifies bot-detection challenges.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Noop

type Noop struct{}

Noop accepts every challenge.

func (Noop) Verify

func (Noop) Verify(context.Context, string, string) error

Verify always accepts the challenge.

type Turnstile

type Turnstile struct {
	Secret string
	Client *http.Client
}

Turnstile verifies challenges using Cloudflare Turnstile.

func (Turnstile) Verify

func (t Turnstile) Verify(ctx context.Context, response, remoteIP string) error

Verify submits a challenge response to Cloudflare and fails closed.

type Verifier

type Verifier interface {
	Verify(context.Context, string, string) error
}

Verifier validates a challenge response.

Jump to

Keyboard shortcuts

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