aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md40
1 files changed, 40 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..6255501
--- /dev/null
+++ b/README.md
@@ -0,0 +1,40 @@
+go-recaptcha
+============
+
+About
+-----
+
+This package handles reCaptcha (http://www.google.com/recaptcha) form
+submissions in Go (http://golang.org/).
+
+Usage
+-----
+
+Install the package in your environment using `go get`:
+
+```
+go get github.com/felix/go-recaptcha
+```
+
+or as part of your source if using [gb](http://getgb.io/).
+
+To use it within your own code, import "github.com/felix/go-recaptcha" and call:
+
+```
+recaptcha.Verify(secret, response, remoteip)
+```
+
+for each reCaptcha form input you need to check, using the values obtained by
+reading the form's POST parameters.
+
+The recaptcha.Verify() function returns a Response struct defined as:
+
+```
+type Response struct {
+ Success bool `json:"success"`
+ // Errors from reCaptcha service
+ ErrorCodes []string `json:"error-codes"`
+ // Our errors to caller
+ Errors []error `json:"-"`
+}
+```