1
0
mirror of https://github.com/astaxie/beego.git synced 2025-06-15 15:50:39 +00:00

Adapter: cache API

This commit is contained in:
Ming Deng
2020-10-04 23:05:37 +08:00
parent 484beb8bad
commit f9bef68aa9
14 changed files with 1044 additions and 5 deletions

View File

@ -114,11 +114,11 @@ func (c *Captcha) Verify(id string, challenge string) (success bool) {
// NewCaptcha create a new captcha.Captcha
func NewCaptcha(urlPrefix string, store cache.Cache) *Captcha {
return (*Captcha)(captcha.NewCaptcha(urlPrefix, store))
return (*Captcha)(captcha.NewCaptcha(urlPrefix, cache.CreateOldToNewAdapter(store)))
}
// NewWithFilter create a new captcha.Captcha and auto AddFilter for serve captacha image
// and add a template func for output html
func NewWithFilter(urlPrefix string, store cache.Cache) *Captcha {
return (*Captcha)(captcha.NewWithFilter(urlPrefix, store))
return (*Captcha)(captcha.NewWithFilter(urlPrefix, cache.CreateOldToNewAdapter(store)))
}