From 0d0a5ce47600878f6d171ec5f050f0a662f5257d Mon Sep 17 00:00:00 2001 From: what Date: Mon, 29 Jan 2024 17:24:51 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E6=96=B0=E5=A2=9E=20Captcha=20?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- captcha.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 captcha.go diff --git a/captcha.go b/captcha.go new file mode 100644 index 0000000..70c0636 --- /dev/null +++ b/captcha.go @@ -0,0 +1,13 @@ +package contracts + +import ( + "net/http" + + "github.com/samber/do" +) + +type Captcha interface { + Middleware(container *do.Injector) func(next http.Handler) http.Handler + Verify(id, answer string, clear bool) bool + Generate(captchaUuid string) (id, answer string) +}