Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCaptcha() string
- func DriverDigitFunc() (id, bs string, err error)
- func RandColor() color.RGBA
- func RandDeepColor() color.RGBA
- func RandLightColor() color.RGBA
- func RandText(size int, sourceChars string) string
- func RandomId() string
- func Verify(id, val string, clear bool) bool
- type Store
Constants ¶
View Source
const ( //TxtNumbers chacters for numbers. TxtNumbers = "012346789" //TxtAlphabet characters for alphabet. TxtAlphabet = "ABCDEFGHJKMNOQRSTUVXYZabcdefghjkmnoqrstuvxyz" )
Variables ¶
View Source
var ( GCLimitNumber = 1024 Expiration = 5 * time.Minute DefaultMemStore = NewMemoryStore(GCLimitNumber, Expiration) )
Functions ¶
func CreateCaptcha ¶
func CreateCaptcha() string
func DriverDigitFunc ¶
func RandLightColor ¶
RandLightColor get random ligth color. 随机生成浅色.
Types ¶
type Store ¶
type Store interface { // Set sets the digits for the captcha id. Set(id string, value string) // Get returns stored digits for the captcha id. Clear indicates // whether the captcha must be deleted from the store. Get(id string, clear bool) string //Verify captcha's answer directly Verify(id, answer string, clear bool) bool }
Click to show internal directories.
Click to hide internal directories.