captcha

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidCaptcha : Error when captcha is invalid
	ErrInvalidCaptcha = errors.New("invalid captcha")
)

Functions

func Authenticate

func Authenticate(req Captcha) bool

Authenticate check's if a Captcha solution is valid

func GetID

func GetID() string

GetID returns a new Captcha ID

func ServeFiles

func ServeFiles(c *gin.Context)

ServeFiles serves Captcha images and audio

Types

type Captcha

type Captcha struct {
	CaptchaID, Solution string
}

Captcha is to be embedded into any form struct requiring a Captcha

func Extract

func Extract(c *gin.Context) Captcha

Extract a Captcha struct from an HTML form

Jump to

Keyboard shortcuts

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