Changed interface and DB struct name in instance.go.

This commit is contained in:
Alexander Andreev 2022-07-30 15:31:47 +04:00
parent 37060dd4ff
commit f7439eb282
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -6,18 +6,18 @@ import (
"time"
)
var captchaDb captcha.CaptchaDB = captcha.CaptchaDB{
DB: make(map[captcha.ID]captcha.ICaptcha)}
var captchaDb captcha.InMemoryCaptchaDB = captcha.InMemoryCaptchaDB{
DB: make(map[captcha.ID]captcha.Captcha)}
func Init(expiry time.Duration) {
captchaDb.SetExpiry(expiry)
}
func New(data string, captcha captcha.ICaptcha) (captcha.ICaptcha, captcha.ID) {
func New(data string, captcha captcha.Captcha) (captcha.Captcha, captcha.ID) {
return captchaDb.New(data, captcha)
}
func Image(id captcha.ID, style string) (*image.Image, error) {
func Image(id captcha.ID, style string) (image.Image, error) {
return captchaDb.Image(id, style)
}