Changed interface and DB struct name in instance.go.
This commit is contained in:
parent
37060dd4ff
commit
f7439eb282
@ -6,18 +6,18 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var captchaDb captcha.CaptchaDB = captcha.CaptchaDB{
|
var captchaDb captcha.InMemoryCaptchaDB = captcha.InMemoryCaptchaDB{
|
||||||
DB: make(map[captcha.ID]captcha.ICaptcha)}
|
DB: make(map[captcha.ID]captcha.Captcha)}
|
||||||
|
|
||||||
func Init(expiry time.Duration) {
|
func Init(expiry time.Duration) {
|
||||||
captchaDb.SetExpiry(expiry)
|
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)
|
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)
|
return captchaDb.Image(id, style)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user