Versions in this module Expand all Collapse all v0 v0.1.1 Apr 12, 2026 v0.1.0 Apr 12, 2026 Changes in this version + func InitGlobalManager(config *Config) + type ClickCaptcha struct + func NewClickCaptcha(width, height, count, tolerance int, expiration time.Duration, store Store) *ClickCaptcha + func (cc *ClickCaptcha) Generate() (*Result, error) + func (cc *ClickCaptcha) Verify(id string, userPositions []Point) (bool, error) + func (cc *ClickCaptcha) VerifyWithoutDelete(id string, userPositions []Point) (bool, error) + type ClickCaptchaData struct + Count int + Image string + Positions []Point + Tolerance int + type Config struct + ClickCount int + ClickHeight int + ClickTolerance int + ClickWidth int + Expiration time.Duration + ImageHeight int + ImageLength int + ImageWidth int + Store Store + func DefaultConfig() *Config + type ImageCaptcha struct + func NewImageCaptcha(width, height, length int, expiration time.Duration, store Store) *ImageCaptcha + func (ic *ImageCaptcha) Generate() (*Result, error) + func (ic *ImageCaptcha) Verify(id, code string) (bool, error) + func (ic *ImageCaptcha) VerifyWithoutDelete(id, code string) (bool, error) + type ImageCaptchaData struct + Code string + Image string + type Manager struct + var GlobalManager *Manager + func NewManager(config *Config) *Manager + func (m *Manager) Generate(captchaType Type) (*Result, error) + func (m *Manager) GenerateClick() (*Result, error) + func (m *Manager) GenerateImage() (*Result, error) + func (m *Manager) Verify(captchaType Type, id string, data interface{}) (bool, error) + func (m *Manager) VerifyClick(id string, positions []Point) (bool, error) + func (m *Manager) VerifyImage(id, code string) (bool, error) + func (m *Manager) VerifyImageWithoutDelete(id, code string) (bool, error) + func (m *Manager) VerifyWithoutDelete(captchaType Type, id string, data interface{}) (bool, error) + type MemoryStore struct + func NewMemoryStore() *MemoryStore + func (s *MemoryStore) Delete(id string) error + func (s *MemoryStore) Get(id string) (interface{}, error) + func (s *MemoryStore) Set(id string, data interface{}, expires time.Time) error + func (s *MemoryStore) VerifyWithFunc(id string, input interface{}, compareFunc func(stored, input interface{}) bool) (bool, error) + func (s *MemoryStore) VerifyWithFuncWithoutDelete(id string, input interface{}, compareFunc func(stored, input interface{}) bool) (bool, error) + type Point struct + X int + Y int + type Result struct + Data map[string]interface{} + Expires time.Time + ID string + Type Type + type Store interface + Delete func(id string) error + Get func(id string) (interface{}, error) + Set func(id string, data interface{}, expires time.Time) error + VerifyWithFunc func(id string, input interface{}, compareFunc func(stored, input interface{}) bool) (bool, error) + VerifyWithFuncWithoutDelete func(id string, input interface{}, compareFunc func(stored, input interface{}) bool) (bool, error) + type Type string + const TypeClick + const TypeImage