Versions in this module Expand all Collapse all v0 v0.0.1 Feb 20, 2020 Changes in this version + const DefaultLeftTimes + const DefaultLen + const Expiration + const StdHeight + const StdWidth + var ErrNotFound = errors.New("captcha: id not found") + func GetID(id string) string + func Handler(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, ...) error + func New() string + func NewID() (id string) + func NewLen(length int) (id string) + func RandomDigits(length int) []byte + func RandomDigitsString(length int) string + func Reload(id string, afterExpire time.Duration, leftTimes int) bool + func Server(imgWidth, imgHeight int) http.Handler + func SetCustomStore(s Store) + func SetID(id string, digits string, afterExpire time.Duration, leftTimes int) + func Verify(id string, digitsString string) bool + func WriteAudio(w io.Writer, id string, lang string) error + func WriteImage(w io.Writer, id string, width, height int) error + type Audio struct + func NewAudio(id string, digitsString string, lang string) *Audio + func (a *Audio) EncodedLen() int + func (a *Audio) WriteTo(w io.Writer) (n int64, err error) + type Image struct + func NewImage(id string, digitsString string, width, height int) *Image + func (m *Image) WriteTo(w io.Writer) (int64, error) + type Store interface + Get func(id string, clear bool) string + Set func(id string, captcha string, afterExpire time.Duration, leftTimes int) + Verify func(id string, captcha string) bool + func NewMemoryStore(interval time.Duration) Store