Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Captcha ¶
type Captcha struct {
// contains filtered or unexported fields
}
func New ¶
func New(size, exp int, dirverType ...CaptchaType) *Captcha
创建验证码实例
- {size} 验证码长度
- {exp} 验证码有效期,单位/秒
- {dirverType} 验证码类型,可选,默认(数值+字母组合)
type CaptchaType ¶
type CaptchaType func(c *Captcha)
验证码类型项
func WithTypeAudio ¶
func WithTypeAudio(lang ...string) CaptchaType
音频验证码
- {lang} 音频语言,可用值:"en"英语,"ja"日语,"ru"俄语,"zh"中文,默认"en"
func WithTypeChinese ¶
func WithTypeChinese(w, h int, opt ...*ImageOption) CaptchaType
中文验证码
- {w},{h} 宽高
- {opt} 可选项参数
func WithTypeMath ¶
func WithTypeMath(w, h int, opt ...*ImageOption) CaptchaType
数学计算验证码
- {w},{h} 宽高
- {opt} 可选项参数
func WithTypeString ¶
func WithTypeString(w, h int, opt ...*ImageOption) CaptchaType
数值字母验证码
- {w},{h} 宽高
- {opt} 可选项参数
Click to show internal directories.
Click to hide internal directories.