u_recaptcha

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECAPTCHA_SECRET_KEY string = "RECAPTCHA_SECRET_KEY"
	RECAPTCHA_THRESHOLD  string = "RECAPTCHA_THRESHOLD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Recaptcha

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

func NewRecaptcha

func NewRecaptcha(httpExecutor u_http_client.HttpExecutor) (*Recaptcha, error)

func (Recaptcha) VerifyCaptcha

func (c Recaptcha) VerifyCaptcha(ctx context.Context, captcha string) error

type SiteVerifyResponse

type SiteVerifyResponse struct {
	Success     bool      `json:"success"`
	Score       float64   `json:"score"`
	Action      string    `json:"action"`
	ChallengeTS time.Time `json:"challenge_ts"`
	Hostname    string    `json:"hostname"`
	ErrorCodes  []string  `json:"error-codes"`
}

func (SiteVerifyResponse) Validate

func (res SiteVerifyResponse) Validate(threshold float64) error

Jump to

Keyboard shortcuts

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