Versions in this module Expand all Collapse all v0 v0.1.0 Dec 4, 2026 Changes in this version + const DefaultMessage + const NoDeadline + const Unlimited + var ErrContended = challenge.ErrContended + var ErrRendererBusy = errors.New("captcha: image renderer is busy") + var ErrTooManyFailures = errors.New("captcha: too many wrong answers; try again in a minute") + var ErrUnknownProfile = errors.New("captcha: unknown profile") + func Check(r *web.Request, value string, opts ...CheckOption) (bool, error) + func CheckKey(ctx context.Context, key, value, profile string) (bool, error) + func Image(r *web.Request, profile string) *web.Response + func Img(ctx context.Context, profile string, attrs ...Attr) template.HTML + func PHPCharacters() []string + func PHPProfiles() map[string]Profile + func Src(ctx context.Context, profile string) string + type Attr struct + Name string + Value string + type Captcha struct + func From(ctx context.Context) *Captcha + func New(configure ...func(cfg *Config)) *Captcha + func (c *Captcha) CheckKeyed(ctx context.Context, key, value, profile string) (Verdict, error) + func (c *Captcha) CheckSession(r *web.Request, value string, opts ...CheckOption) (Verdict, error) + func (c *Captcha) Config() Config + func (c *Captcha) Issue(ctx context.Context, profile string) (Challenge, error) + func (c *Captcha) RecordAnswers(record func(key, answer string)) + func (c *Captcha) Register(app *laravel.Registrar) error + type Challenge struct + Image []byte + Key string + Profile string + Sensitive bool + func Issue(ctx context.Context, profile string) (Challenge, error) + func (ch Challenge) DataURI() string + func (ch Challenge) NoStore(res *web.Response) *web.Response + type CheckOption func(*checkOptions) + func WithProfile(name string) CheckOption + type Config struct + AssetFS fs.FS + Backgrounds []string + Characters []string + Disable bool + Failures int + Field string + Fonts []string + KeyField string + NoDeadlineLifetime time.Duration + Profiles map[string]Profile + RenderConcurrency int + Renderer Renderer + SingleProcess bool + Store string + Throttle int + TrustStore bool + func ParsePHPConfig(data []byte) (Config, error) + type KeyedRule struct + func Keyed() KeyedRule + func KeyedWith(key string) KeyedRule + func (KeyedRule) Implicit() bool + func (k KeyedRule) Profile(name string) KeyedRule + func (k KeyedRule) Validate(ctx context.Context, field validation.Field) error + type Kind challenge.Kind + const Exhausted + const Expired + const Missing + const Passed + const ProfileMismatch + const Wrong + func (k Kind) String() string + type Profile struct + Angle int + Attempts int + Backgrounds []string + BgColor string + BgImage bool + Blur int + Characters []string + Contrast int + Expire time.Duration + FontColors []string + Fonts []string + Height int + Invert bool + Length int + LineColor string + LineWidth int + Lines int + MarginTop int + Math bool + Quality int + Sensitive bool + Sharpen int + TextLeftPadding int + Width int + func Defaults() Profile + type Renderer interface + Render func(ctx context.Context, profile string, p Profile, text []string) ([]byte, error) + type SessionRule struct + func Rule(r *web.Request) SessionRule + func (SessionRule) Implicit() bool + func (s SessionRule) Profile(name string) SessionRule + func (s SessionRule) Validate(ctx context.Context, field validation.Field) error + type Verdict struct + Kind Kind + Remaining int