Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
// The secret key for reCAPTCHA v3. Required.
Secret string
// A string indicating the expected action. For example: "login" or "contact".
ExpectedAction string
// The lowest acceptable score for the reCAPTCHA validation.
MinScore float64
// Optional Resty client
Client *resty.Client
}
Config holds the parameters to build a real verifier
type GoogleVerifier ¶
type GoogleVerifier struct {
Secret string
ExpectedAction string
MinScore float64
Client *resty.Client
}
func NewGoogleVerifier ¶
func NewGoogleVerifier(cfg Config) (*GoogleVerifier, error)
type MockVerifier ¶
type RecaptchaResponse ¶
type RecaptchaResponse struct {
Success bool `json:"success"`
ChallengeTS string `json:"challenge_ts"`
Hostname string `json:"hostname"`
Score float64 `json:"score"`
Action string `json:"action"`
ErrorCodes []string `json:"error-codes"`
}
reCAPTCHA response
type RestyConfig ¶
Click to show internal directories.
Click to hide internal directories.