Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IHttpClient ¶ added in v1.1.0
type IHttpClient interface {
PostForm(url string, data url.Values) (resp *http.Response, err error)
}
IHttpClient abstracts http client (net/http) for testing.
type IRecaptcha ¶ added in v1.1.0
IRecaptcha abstracts recaptcha struct for testing / using.
type Recaptcha ¶
type Recaptcha struct { SecKey string Client IHttpClient }
Recaptcha is a structure to handle recaptcha
type Response ¶
type Response struct { Success bool `json:"success,omitempty"` Score float64 `json:"score,omitempty"` Action string `json:"action,omitempty"` ChallengeTime time.Time `json:"challenge_ts,omitempty"` HostName string `json:"host,omitempty"` Errors []string `json:"error-codes,omitempty"` }
Response represents the response from the server. It includes whethere the captcha is succeeded, the score (v3), action, time of the challenge, the name of the host, and error codes.
type ResponseError ¶
type ResponseError struct { Response *http.Response // Note: Response.Body is always closed in this case. Body string }
ResponseError represents the error of response from the server.
func (*ResponseError) Error ¶
func (r *ResponseError) Error() string
Click to show internal directories.
Click to hide internal directories.