Skip to content

Latest commit

 

History

History
36 lines (28 loc) · 1.46 KB

File metadata and controls

36 lines (28 loc) · 1.46 KB

reCaptcha

GoDoc Build Status Go Report Card License

reCaptcha defines the functionality for verification of reCaptcha tokens (all version) generated on the client site.

To make this project independent to any web server there is not an executable file/script, but only the library is performing the basic evaluation of provided token and result is captured in the VerifyResponse structure.

User of this library can define endpoints as the project requires. The only one required task is to define one environmental variable SECRET_KEY which has to hold the generated secret key value.

Installation

go get module github.com/lukasaron/recaptcha

Example of usage

package main

import (
	"fmt"
	"github.com/lukasaron/recaptcha"
)

func main() {
    token := "--- accept the token from the client side and pass it here --- "
    remoteIP := "--- fill the remote IP or leave empty --- "
	r, err := recaptcha.VerifyToken(token, remoteIP)
	fmt.Printf("Response: %+v\n, error: %v", r, err)
}