Versions in this module Expand all Collapse all v0 v0.0.1 Dec 31, 2023 Changes in this version + const ErrorCodeBadRequest + const ErrorCodeInternalError + const ErrorCodeInvalidInputResponse + const ErrorCodeInvalidInputSecret + const ErrorCodeMissingInputResponse + const ErrorCodeMissingInputSecret + const ErrorCodeTimeoutOrDuplicate + type CaptchaVerifier struct + HttpClient *http.Client + func NewCaptchaVerifier(captchaEndpoint Endpoint, captchaSecret string) *CaptchaVerifier + func (client *CaptchaVerifier) DisablePostJSON(on bool) *CaptchaVerifier + func (client *CaptchaVerifier) Verify(clientResponse, remoteIP string) (resp *VerifyResponse, err error) + type Endpoint string + const CloudflareTurnstile + const GoogleRecaptcha + type ErrorNon200StatusCode struct + StatusCode int + func (err ErrorNon200StatusCode) Error() string + type SimpleCaptchaVerifier struct + ExpectedAction string + ExpectedApkPackageName string + ExpectedHostname string + MinScore float32 + Verifier CaptchaVerifier + func (verifier SimpleCaptchaVerifier) Verify(clientResponse, remoteIP string) (bool, error) + func (verifier SimpleCaptchaVerifier) VerifyAction(clientResponse, remoteIP, expectedAction string) (bool, error) + func (verifier SimpleCaptchaVerifier) VerifyActionWithResponse(clientResponse, remoteIP, expectedAction string) (*VerifyResponse, bool, error) + func (verifier SimpleCaptchaVerifier) VerifyWithResponse(clientResponse, remoteIP string) (*VerifyResponse, bool, error) + type VerifyRequest struct + RemoteIP string + Response string + Secret string + func (req *VerifyRequest) DisablePostJSON(on bool) *VerifyRequest + func (req *VerifyRequest) Verify(client *http.Client, endpoint Endpoint) (resp *VerifyResponse, err error) + type VerifyResponse struct + Action string + ApkPackageName string + CData string + ChallengeTime string + ErrorCodes []string + Hostname string + Score float32 + Success bool + func (resp *VerifyResponse) ParsedChallengeTime() (time.Time, error)