recaptcha

package
Version: v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 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

Source Files

Jump to

Keyboard shortcuts

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