17 Star 44 Fork 12

hanguofeng / gocaptcha

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
storeinterface.go 646 Bytes
一键复制 编辑 原始数据 按行查看 历史
dtynn 提交于 2014-12-23 15:02 . register store
// Copyright 2013 hanguofeng. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package gocaptcha
import ()
var storeCreators = map[string]func(*StoreConfig) (StoreInterface, error){}
//StoreInterface is the interface of store
type StoreInterface interface {
Get(key string) *CaptchaInfo
Add(captcha *CaptchaInfo) string
Del(key string)
Destroy()
OnConstruct()
OnDestruct()
}
func RegisterStore(name string, f func(*StoreConfig) (StoreInterface, error)) bool {
if _, has := storeCreators[name]; has {
return false
}
storeCreators[name] = f
return true
}
1
https://gitee.com/hanguofeng/gocaptcha.git
git@gitee.com:hanguofeng/gocaptcha.git
hanguofeng
gocaptcha
gocaptcha
master

搜索帮助