Documentation
¶
Index ¶
- Constants
- func VerifyCaptchaByCaptchaType(captchaType, token, clientId, clientSecret, clientId2 string) (bool, error)
- type AliyunCaptchaProvider
- type CaptchaProvider
- type CloudflareTurnstileProvider
- type DefaultCaptchaProvider
- type GEETESTCaptchaProvider
- type HCaptchaProvider
- type ReCaptchaProvider
- type VerifyCaptchaRequest
- type VerifyCaptchaResponseBody
- type VerifyCaptchaResponseBodyResult
- type VerifyIntelligentCaptchaResponse
- type VerifyIntelligentCaptchaResponseBody
- type VerifyIntelligentCaptchaResponseBodyResult
Constants ¶
View Source
const AliyunCaptchaVerifyUrl = "captcha.cn-shanghai.aliyuncs.com"
View Source
const CloudflareTurnstileVerifyUrl = "https://challenges.cloudflare.com/turnstile/v0/siteverify"
View Source
const GEETESTCaptchaVerifyUrl = "http://gcaptcha4.geetest.com/validate"
View Source
const HCaptchaVerifyUrl = "https://hcaptcha.com/siteverify"
View Source
const ReCaptchaVerifyUrl = "https://recaptcha.net/recaptcha/api/siteverify"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AliyunCaptchaProvider ¶
type AliyunCaptchaProvider struct{}
func NewAliyunCaptchaProvider ¶
func NewAliyunCaptchaProvider() *AliyunCaptchaProvider
func (*AliyunCaptchaProvider) VerifyCaptcha ¶
func (captcha *AliyunCaptchaProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type CaptchaProvider ¶
type CaptchaProvider interface {
VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
}
func GetCaptchaProvider ¶
func GetCaptchaProvider(captchaType string) CaptchaProvider
type CloudflareTurnstileProvider ¶
type CloudflareTurnstileProvider struct{}
func NewCloudflareTurnstileProvider ¶
func NewCloudflareTurnstileProvider() *CloudflareTurnstileProvider
func (*CloudflareTurnstileProvider) VerifyCaptcha ¶
func (captcha *CloudflareTurnstileProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type DefaultCaptchaProvider ¶
type DefaultCaptchaProvider struct{}
func NewDefaultCaptchaProvider ¶
func NewDefaultCaptchaProvider() *DefaultCaptchaProvider
func (*DefaultCaptchaProvider) VerifyCaptcha ¶
func (captcha *DefaultCaptchaProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type GEETESTCaptchaProvider ¶
type GEETESTCaptchaProvider struct{}
func NewGEETESTCaptchaProvider ¶
func NewGEETESTCaptchaProvider() *GEETESTCaptchaProvider
func (*GEETESTCaptchaProvider) VerifyCaptcha ¶
func (captcha *GEETESTCaptchaProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type HCaptchaProvider ¶
type HCaptchaProvider struct{}
func NewHCaptchaProvider ¶
func NewHCaptchaProvider() *HCaptchaProvider
func (*HCaptchaProvider) VerifyCaptcha ¶
func (captcha *HCaptchaProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type ReCaptchaProvider ¶
type ReCaptchaProvider struct{}
func NewReCaptchaProvider ¶
func NewReCaptchaProvider() *ReCaptchaProvider
func (*ReCaptchaProvider) VerifyCaptcha ¶
func (captcha *ReCaptchaProvider) VerifyCaptcha(token, clientId, clientSecret, clientId2 string) (bool, error)
type VerifyCaptchaRequest ¶
type VerifyCaptchaResponseBody ¶
type VerifyCaptchaResponseBody struct {
Code *string `json:"Code,omitempty" xml:"Code,omitempty"`
Message *string `json:"Message,omitempty" xml:"Message,omitempty"`
// Id of the request
RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"`
Result *VerifyCaptchaResponseBodyResult `json:"Result,omitempty" xml:"Result,omitempty" type:"Struct"`
Success *bool `json:"Success,omitempty" xml:"Success,omitempty"`
}
type VerifyCaptchaResponseBodyResult ¶
type VerifyCaptchaResponseBodyResult struct {
VerifyResult *bool `json:"VerifyResult,omitempty" xml:"VerifyResult,omitempty"`
}
type VerifyIntelligentCaptchaResponse ¶
type VerifyIntelligentCaptchaResponse struct {
Headers map[string]*string `json:"headers,omitempty" xml:"headers,omitempty" require:"true"`
StatusCode *int32 `json:"statusCode,omitempty" xml:"statusCode,omitempty" require:"true"`
Body *VerifyIntelligentCaptchaResponseBody `json:"body,omitempty" xml:"body,omitempty" require:"true"`
}
type VerifyIntelligentCaptchaResponseBody ¶
type VerifyIntelligentCaptchaResponseBody struct {
Code *string `json:"Code,omitempty" xml:"Code,omitempty"`
Message *string `json:"Message,omitempty" xml:"Message,omitempty"`
// Id of the request
RequestId *string `json:"RequestId,omitempty" xml:"RequestId,omitempty"`
Result *VerifyIntelligentCaptchaResponseBodyResult `json:"Result,omitempty" xml:"Result,omitempty" type:"Struct"`
Success *bool `json:"Success,omitempty" xml:"Success,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.