31 Star 127 Fork 43

ShirDon-廖显东 / go验证码合集包

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
imagefilter.go 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
shirdon 提交于 2019-07-07 16:16 . commit
//++++++++++++++++++++++++++++++++++++++++
//Fighting for great,share generate value!
//Build the best soft by golang,let's go!
//++++++++++++++++++++++++++++++++++++++++
//Author:ShirDon <http://www.shirdon.com>
//Email:hcbsts@163.com; 823923263@qq.com
//++++++++++++++++++++++++++++++++++++++++
package captchas_with_go
var imageFilterCreators = map[string]func(FilterConfigGroup) ImageFilter{}
func RegisterImageFilter(id string, f func(FilterConfigGroup) ImageFilter) bool {
if _, has := imageFilterCreators[id]; has {
return false
}
imageFilterCreators[id] = f
return true
}
//ImageFilter is the interface of image filter
type ImageFilter interface {
Proc(cimage *CImage)
GetId() string
SetConfig(FilterConfigGroup)
GetConfig() FilterConfigGroup
}
//ImageFilter is the base class of image filter
type ImageFilterBase struct {
config FilterConfigGroup
}
func (filter *ImageFilterBase) Proc(cimage *CImage) {
panic("not impl")
}
func (filter *ImageFilterBase) GetId() string {
panic("not impl")
}
func (filter *ImageFilterBase) SetConfig(config FilterConfigGroup) {
filter.config = config
}
func (filter *ImageFilterBase) GetConfig() FilterConfigGroup {
return filter.config
}
Go
1
https://gitee.com/shirdonl/captchas_with_go.git
git@gitee.com:shirdonl/captchas_with_go.git
shirdonl
captchas_with_go
go验证码合集包
master

搜索帮助