turnstile

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeMissingInputSecret   = errors.New("missing-input-secret")
	ErrCodeInvalidInputSecret   = errors.New("invalid-input-secret")
	ErrCodeMissingInputResponse = errors.New("missing-input-response")
	ErrCodeInvalidInputResponse = errors.New("invalid-input-response")
	ErrCodeBadRequest           = errors.New("bad-request")
	ErrCodeTimeoutOrDuplicate   = errors.New("timeout-or-duplicate")
	ErrCodeInternalError        = errors.New("internal-error")
)

Functions

This section is empty.

Types

type Request

type Request struct {
	Secret string
	Token  string
	IP     string
}

type Response

type Response struct {
	Success   bool      `json:"success,omitempty"`
	Errors    []error   `json:"errors,omitempty"`
	Timestamp time.Time `json:"challenge_ts,omitempty"`
	Hostname  string    `json:"hostname,omitempty"`
}

func VerifyCaptcha

func VerifyCaptcha(ctx context.Context, r Request) (*Response, error)

Jump to

Keyboard shortcuts

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