Documentation ¶
Overview ¶
Package recaptcha handles reCAPTCHA (http://www.google.com/recaptcha) form submissions
This package is designed to be called from within an HTTP server or web framework which offers reCAPTCHA form inputs and requires them to be evaluated for correctness
Index ¶
Constants ¶
View Source
const DefaultVerifyEndpoint = "https://www.google.com/recaptcha/api/siteverify"
DefaultVerifyEndpoint is the default production endpoint for verifying a token.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Recaptcha ¶
type Recaptcha struct { VerifyEndpoint string // This is the endpoint; if empty, it will default to the production endpoint. PrivateKey string // This is your site's private key. // contains filtered or unexported fields }
Recaptcha contains the configuration and functions necessary to perform reCAPTCHA validations.
type RecaptchaResponse ¶
type RecaptchaResponse struct { Success bool `json:"success"` // Whether this request was a valid reCAPTCHA token for your site. Score float64 `json:"score"` // (v3 only) The score for this request (0.0 - 1.0). Action string `json:"action"` // (v3 only) The action name for this request (important to verify). ChallengeTS time.Time `json:"challenge_ts"` // Timestamp of the challenge load (ISO format yyyy-MM-dd'T'HH:mm:ssZZ). Hostname string `json:"hostname"` // The hostname of the site where the reCAPTCHA was solved. ErrorCodes []string `json:"error-codes"` // (Optional) }
RecaptchaResponse is the response that we get back from the "siteverify" endpoint.
Click to show internal directories.
Click to hide internal directories.