Documentation ¶
Overview ¶
* * @Author: ITWorker * @Date: 2021/2/19 13:36 * @Description:拖动验证码
Index ¶
- func NewRedisCaptchaStore(network, address string, opts ...redis.DialOption) *redisCaptchaStore
- func WithDragCaptchaBase(basePath string) func(o *Captcha)
- func WithDragCaptchaDeviation(deviation int) func(o *Captcha)
- func WithDragCaptchaMask(maskPath string) func(o *Captcha)
- type Captcha
- type CaptchaStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRedisCaptchaStore ¶
func NewRedisCaptchaStore(network, address string, opts ...redis.DialOption) *redisCaptchaStore
func WithDragCaptchaDeviation ¶
设置允许误差
Types ¶
type Captcha ¶
type Captcha struct {
// contains filtered or unexported fields
}
func NewDragCaptcha ¶
func NewDragCaptcha(store CaptchaStore) (*Captcha, error)
func (*Captcha) CreateImage ¶
func (c *Captcha) CreateImage(key string, fns ...func(o *Captcha)) (dstImage *image.RGBA, err error)
生成验证码,并存储 返回文件流 在指定图片上面画蒙板
dst 绘图的背景图。 r 是背景图的绘图区域 src 是要绘制的图 sp 是 src 对应的绘图开始点(绘制的大小 r变量定义了) mask 是绘图时用的蒙版,控制替换图片的方式。 mp 是绘图时蒙版开始点(绘制的大小 r变量定义了)
func (*Captcha) MaskOffset ¶
Click to show internal directories.
Click to hide internal directories.