Commit Graph

13 Commits

Author SHA1 Message Date
c14f9b0149
ICaptcha interface renamed to Captcha. generateImage() method removed. Instead image is being generated returned by value in Image() method that formely was named a GetImage() method. Base captcha implementation renamed to BaseCaptcha. 2022-07-30 15:37:05 +04:00
21e5ec118e
Added comment for CaptchaDB.GetExpiry(). 2022-06-27 03:19:39 +04:00
149675cd86
Fixed mutexes. Now program doesn't fall under high load.
Seems like an old expiry comparing didn't work as left thousands of expired captchas in a map, so it was replaced by a forgotten by me time.Since() function.
2022-06-27 02:48:55 +04:00
96c13ec6b2
Added support for different styles for CAPTCHA. 2022-06-27 01:20:36 +04:00
8f6ea671c6
Made use of mutex in a goroutine that cleans expired captchas. 2022-06-27 01:05:44 +04:00
b0d5f9d9d0
Embed sync.Mutex in CaptchaDB struct in order to directly call its methods. 2022-06-27 01:03:28 +04:00
b65f3be236
ID generating moved off to a separate function NewID(). 2022-06-27 01:02:24 +04:00
9ed5ad42e2
generateAnswer() function made into a private. And now being called by GetAnswer() method in Captcha. 2022-06-27 00:44:11 +04:00
10167c4e17
Added comments for ICaptcha interface. 2022-06-27 00:43:12 +04:00
28ceae169b
ID type moved to db.go file where it belongs. 2022-06-27 00:26:03 +04:00
508d44a512
In db.go GetExpireInterval() renamed to GetExpiry(). 2022-06-26 23:59:19 +04:00
8053952122
Captcha implementation was moved off to pkg directory to be able to be used as an external library. 2022-06-26 23:53:52 +04:00
21b2f24986
Initial commit with a fully working program, lel. 2022-06-24 23:09:46 +04:00