captcha

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCaptchaNotExists    = errors.NewPublic("the captcha does not exists")
	ErrCaptchaInconsistent = errors.NewPublic("tha captcha is invalid")
)

Functions

This section is empty.

Types

type Captcha

type Captcha struct {
	Namespace string
	Redis     *redis.Client
}

func New added in v0.0.7

func New(options ...Option) *Captcha

func (*Captcha) Create

func (x *Captcha) Create(ctx context.Context, name string, code string, ttl time.Duration) error

func (*Captcha) Delete

func (x *Captcha) Delete(ctx context.Context, name string) error

func (*Captcha) Exists

func (x *Captcha) Exists(ctx context.Context, name string) (_ bool, err error)

func (*Captcha) Key

func (x *Captcha) Key(name string) string

func (*Captcha) Verify

func (x *Captcha) Verify(ctx context.Context, name string, code string) (err error)

type Option added in v0.0.7

type Option func(x *Captcha)

func SetNamespace added in v0.0.7

func SetNamespace(v string) Option

func SetRedis added in v0.0.7

func SetRedis(v *redis.Client) Option

Jump to

Keyboard shortcuts

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