Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HCaptcha ¶
type HCaptcha interface {
// Verify verifies the given token. An optional remote IP of the user may be
// passed as extra security criteria.
Verify(token string, remoteIP ...string) (*Response, error)
}
HCaptcha is a hCaptcha verify service.
type Options ¶
type Options struct {
// Client the HTTP client to make requests. The default is http.DefaultClient.
Client *http.Client
// Secret is the secret key to check user captcha codes. This field is required.
Secret string
}
Options contains options for both hcaptcha.Captcha middleware.
type Response ¶
type Response struct {
// Success indicates whether the passcode valid, and does it meet security
// criteria you specified.
Success bool `json:"success"`
// ChallengeTS is the timestamp of the challenge (ISO format
// yyyy-MM-dd'T'HH:mm:ssZZ).
ChallengeTS time.Time `json:"challenge_ts"`
// Hostname is the hostname of the site where the challenge was solved.
Hostname string `json:"hostname"`
// Credit indicates whether the response will be credited.
Credit bool `json:"credit"`
// ErrorCodes contains the error codes when verify failed.
ErrorCodes []string `json:"error-codes"`
}
Response is the response struct which hCaptcha sends back.
Click to show internal directories.
Click to hide internal directories.