restructure

This commit is contained in:
yanghao05
2023-04-20 12:11:34 +08:00
parent 6757e00d73
commit 5b8eca5d87
120 changed files with 546 additions and 7303 deletions

View File

@@ -0,0 +1,25 @@
package captcha
import (
"log"
"time"
)
type Config struct {
Long uint // 验证码长度
Width uint // 验证码宽度
Height uint // 验证码高度
Open uint // 防爆破验证码开启此数0代表每次登录都需要验证码其他数字代表错误密码此数如3代表错误三次后出现验证码
OpenTimeOut string // 防爆破验证码超时时间单位s(秒)
MaxScrew float64 // MaxSkew max absolute skew factor of a single digit.
DotCount int // Number of background circles.
}
func (c *Config) OpenCaptchaTimeOutDuration() time.Duration {
d, err := time.ParseDuration(c.OpenTimeOut)
if err != nil {
log.Panic(err)
}
return d
}