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 ¶
func VerifyCaptchaByCaptchaType ¶ added in v1.145.0
Types ¶
type AliyunCaptchaProvider ¶ added in v1.62.0
type AliyunCaptchaProvider struct{}
func NewAliyunCaptchaProvider ¶ added in v1.62.0
func NewAliyunCaptchaProvider() *AliyunCaptchaProvider
func (*AliyunCaptchaProvider) VerifyCaptcha ¶ added in v1.62.0
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 ¶ added in v1.167.0
type CloudflareTurnstileProvider struct{}
func NewCloudflareTurnstileProvider ¶ added in v1.167.0
func NewCloudflareTurnstileProvider() *CloudflareTurnstileProvider
func (*CloudflareTurnstileProvider) VerifyCaptcha ¶ added in v1.167.0
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 ¶ added in v1.81.0
type GEETESTCaptchaProvider struct{}
func NewGEETESTCaptchaProvider ¶ added in v1.81.0
func NewGEETESTCaptchaProvider() *GEETESTCaptchaProvider
func (*GEETESTCaptchaProvider) VerifyCaptcha ¶ added in v1.81.0
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 ¶ added in v1.935.0
type VerifyCaptchaResponseBody ¶ added in v1.935.0
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 ¶ added in v1.935.0
type VerifyCaptchaResponseBodyResult struct {
VerifyResult *bool `json:"VerifyResult,omitempty" xml:"VerifyResult,omitempty"`
}
type VerifyIntelligentCaptchaResponse ¶ added in v1.935.0
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 ¶ added in v1.935.0
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"`
}
type VerifyIntelligentCaptchaResponseBodyResult ¶ added in v1.935.0
Click to show internal directories.
Click to hide internal directories.