Documentation
¶
Index ¶
Constants ¶
View Source
const ( // V2 recaptcha api v2 V2 VERSION = iota // V3 recaptcha api v3, more details can be found here : https://developers.google.com/recaptcha/docs/v3 V3 DEFAULT_TRESHOLD float32 = 0.5 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReCAPTCHA ¶
type ReCAPTCHA struct { Client netClient Secret string ReCAPTCHALink string Version VERSION Timeout uint // contains filtered or unexported fields }
ReCAPTCHA recpatcha holder struct, make adding mocking code simpler
func NewReCAPTCHA ¶
NewReCAPTCHA Create new ReCAPTCHA with the v2 reCAPTCHA secret optained from https://www.google.com/recaptcha/admin or https://www.google.com/recaptcha/admin
func (*ReCAPTCHA) Verify ¶
Verify returns (true, nil) if no error the client answered the challenge correctly and have correct remoteIP
func (*ReCAPTCHA) VerifyWithOptions ¶
func (r *ReCAPTCHA) VerifyWithOptions(challengeResponse string, options VerifyOption) error
VerifyWithOptions returns (true, nil) if no error the client answered the challenge correctly and have correct remoteIP
Click to show internal directories.
Click to hide internal directories.