Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct {
Success bool `json:"success"`
ErrorCodes []string `json:"error-codes"`
ChallengeTS time.Time `json:"challenge_ts"`
Hostname string `json:"hostname"`
Action string `json:"action"`
ClientData string `json:"cdata"`
}
Response is the response received from cloudflare siteverify endpoint.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier verifies Cloudflare issued Turnstile tokens with the siteverify endpoint as described here https://developers.cloudflare.com/turnstile/get-started/server-side-validation/.
A verifier is safe for concurrent use by multiple goroutines.
func NewVerifier ¶
NewVerifier returns an initialized Verifier. `secret` is the key obtained from cloudflare when creating the turnstile site. `httpClient` is used to post verification requests to the cloudflare endpoint, if nil, `http.DefaultClient` is used.
Click to show internal directories.
Click to hide internal directories.