recaptcha

package
v0.0.0-...-f1b76ca Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package recaptcha handles reCaptcha (http://www.google.com/recaptcha) form submissions

This package is designed to be called from within an HTTP server or web framework which offers reCaptcha form inputs and requires them to be evaluated for correctness

Edit the recaptchaPrivateKey constant before building and using

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(remoteip, response string) (result bool)

Confirm is the public interface function. It calls check, which the client ip address, the challenge code from the reCaptcha form, and the client's response input to that challenge to determine whether or not the client answered the reCaptcha input question correctly. It returns a boolean value indicating whether or not the client answered correctly.

func Init

func Init(key string)

Init allows the webserver or code evaluating the reCaptcha form input to set the reCaptcha private key (string) value, which will be different for every domain.

Types

type RecaptchaResponse

type RecaptchaResponse struct {
	Success     bool      `json:"success"`
	ChallengeTS time.Time `json:"challenge_ts"`
	Hostname    string    `json:"hostname"`
	ErrorCodes  []int     `json:"error-codes"`
}

Jump to

Keyboard shortcuts

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