1 Star 0 Fork 43

Shirdon / go验证码合集包

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
configtypes.go 1.69 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
import (
"time"
)
//CaptchaConfig ,the captcha config
type CaptchaConfig struct {
LifeTime time.Duration
CaseSensitive bool
ChangeTextOnRefresh bool
}
//FilterConfigGroup
type FilterConfigGroup struct {
data map[string]string
}
func (this *FilterConfigGroup) Init() {
this.data = map[string]string{}
}
func (this *FilterConfigGroup) GetItem(key string) (string, bool) {
val, ok := this.data[key]
return val, ok
}
func (this *FilterConfigGroup) SetItem(key string, val string) {
this.data[key] = val
}
type FilterConfig struct {
Filters []string
data map[string]*FilterConfigGroup
}
func (this *FilterConfig) Init() {
this.Filters = []string{}
this.data = map[string]*FilterConfigGroup{}
}
func (this *FilterConfig) GetGroup(key string) (FilterConfigGroup, bool) {
val, ok := this.data[key]
if !ok {
val = new(FilterConfigGroup)
}
return *val, ok
}
func (this *FilterConfig) SetGroup(key string, group *FilterConfigGroup) {
this.data[key] = group
}
//ImageConfig ,the image config
type ImageConfig struct {
Width int
Height int
FontSize float64
FontFiles []string
fontManager *FontManager
}
const STORE_ENGINE_BUILDIN = "buildin"
const STORE_ENGINE_MEMCACHE = "memcache"
//StoreConfig ,the store engine config
type StoreConfig struct {
CaptchaConfig
Engine string
Servers []string
GcProbability int
GcDivisor int
}
Go
1
https://gitee.com/shirdon/captchas_with_go.git
git@gitee.com:shirdon/captchas_with_go.git
shirdon
captchas_with_go
go验证码合集包
master

搜索帮助