From 0e0c91b5c2609e8dc64e251253b5944adca42aaf Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Thu, 20 Oct 2022 22:51:32 +0400 Subject: [PATCH] instance.go was removed and its content was made as part of InMemoryCaptchaDB. --- internal/captcha/instance.go | 38 ------------------------------------ 1 file changed, 38 deletions(-) delete mode 100644 internal/captcha/instance.go diff --git a/internal/captcha/instance.go b/internal/captcha/instance.go deleted file mode 100644 index 946a818..0000000 --- a/internal/captcha/instance.go +++ /dev/null @@ -1,38 +0,0 @@ -package captcha - -import ( - "image" - "justcaptcha/pkg/captcha" - "time" -) - -var captchaDb captcha.CaptchaDB - -func Init(expiry time.Duration) { - captchaDb = captcha.NewInMemoryCaptchaDB(expiry) -} - -func New(data string) (captcha.Captcha, captcha.ID) { - dc := NewDwellingCaptcha(captchaDb.GetExpiry()) - return captchaDb.New(data, dc) -} - -func Image(id captcha.ID, style string) (*image.Image, error) { - return captchaDb.Image(id, style) -} - -func Solve(id captcha.ID, answer captcha.Answer) (bool, error) { - return captchaDb.Solve(id, answer) -} - -func IsSolved(id captcha.ID) (bool, error) { - return captchaDb.IsSolved(id) -} - -func Remove(id captcha.ID) error { - return captchaDb.Remove(id) -} - -func GetExpiry() time.Duration { - return captchaDb.GetExpiry() -}