Documentation ¶
Index ¶
- Constants
- Variables
- type Captcha
- type Dot
- type Option
- func WithDriver(driver *captcha.Captcha) Option
- func WithQuality(quality int) Option
- func WithSlideBackDir(backDir string) Option
- func WithSlideMaskDir(maskDir string) Option
- func WithWordsZhBackImgList(backImgList []string) Option
- func WithWordsZhCnChars(chars []string) Option
- func WithWordsZhCnImgSize(size captcha.Size) Option
- func WithWordsZhCnThumbSize(size captcha.Size) Option
- type Slide
- func (s *Slide) Check(dots string, dct map[int]Dot, span int) bool
- func (s *Slide) Create() (dots map[int]Dot, b64 string, thumb64 string, key string, err error)
- func (s *Slide) CreateCustom(r, quality int) (dots map[int]Dot, b64 string, thumb64 string, key string, err error)
- func (s *Slide) CreateShape(img *image.RGBA, point image.Point, r int) *image.RGBA
- type WordsZhCn
Constants ¶
View Source
const ( TypeSlide = 1 TypeWordsZhCn = 2 )
View Source
const ( MimePng = `image/png` MimeJpg = `image/jpg` MimeJpeg = `image/jpeg` )
Variables ¶
View Source
var ( // DefaultSlide default slide driver object DefaultSlide = NewSlide("", "", 70) )
View Source
var (
ErrFormat = errors.New("mime format unsupported")
)
Functions ¶
This section is empty.
Types ¶
type Captcha ¶
type Captcha interface { Check(dots string, dct map[int]Dot, span int) bool Create() (dots map[int]Dot, b64 string, thumb64 string, key string, err error) }
func NewWithOptions ¶
type Option ¶
type Option func(opt *options)
func WithDriver ¶
func WithQuality ¶
func WithSlideBackDir ¶
func WithSlideMaskDir ¶
func WithWordsZhBackImgList ¶
func WithWordsZhCnChars ¶
func WithWordsZhCnImgSize ¶
func WithWordsZhCnThumbSize ¶
type Slide ¶
type Slide struct {
// contains filtered or unexported fields
}
Slide _
func SlideWithBack ¶
SlideWithBack new slide with background image list
func SlideWithMask ¶
SlideWithMask new slide with mask image list
Click to show internal directories.
Click to hide internal directories.