entity.go 943 B

12345678910111213141516171819202122232425262728293031323334
  1. package captcha
  2. import (
  3. "github.com/wenlng/go-captcha/v2/click"
  4. "github.com/wenlng/go-captcha/v2/rotate"
  5. "github.com/wenlng/go-captcha/v2/slide"
  6. "sync"
  7. )
  8. const (
  9. MiniTimes = 3
  10. MaxTimes = 7
  11. Padding int64 = 4
  12. )
  13. var (
  14. slideFuncS []slide.Captcha
  15. clickFuncS []click.Captcha
  16. rotateFuncS []rotate.Captcha
  17. rd = RandomNumberGenerator()
  18. redisTtl = 10 * 60
  19. SendCodeTtl = 30 * 60
  20. RedisCode = "other"
  21. MoldCacheKey = "captcha_mold_%s_%s"
  22. ResCacheKey = "captcha_res_%s_%s"
  23. SendCodeKey = "send_phone_check_%s_%s"
  24. MobileCacheKey = "mobile_captcha_%s"
  25. SendCodeCacheValue = "send_phone_check_%s_%sValue"
  26. SendCodeCacheKey = "send_phone_check_%s_%sKey"
  27. SendCodeCacheTime = "send_phone_check_%s_%sTime"
  28. TimesCacheKey = "captcha_times_new_%s"
  29. CaptLockMap = map[string]*sync.Mutex{}
  30. CaptLock = &sync.Mutex{}
  31. )