recaptcha

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2020 License: MIT Imports: 4 Imported by: 0

README

go-recaptcha

GoDoc

robot

Documentation

Overview

Package recaptcha handles reCaptcha (http://www.google.com/recaptcha) server side validation

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"`
	Score       float64   `json:"score"`
	Action      string    `json:"action"`
	ChallengeTS time.Time `json:"challenge_ts"`
	Hostname    string    `json:"hostname"`
	ErrorCodes  []string  `json:"error-codes"`
}

Response from recaptcha

type Verifier

type Verifier struct {
	APIURL string
	Client *http.Client
	// contains filtered or unexported fields
}

Verifier allows to verify a recaptcha You can change the API URL and the http.Client (before you start using Verify to avoid race conditions)

func New

func New(privateKey string) Verifier

New instance with the default URL (https://www.google.com/recaptcha/api/siteverify)

func (Verifier) Verify

func (v Verifier) Verify(response string) (Response, error)

Verify a recaptcha this function is thread safe

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL