Documentation
¶
Index ¶
- Constants
- type BlockPuzzleCaptchaService
- type CaptchaCacheInterface
- type CaptchaInterface
- type CaptchaServiceFactory
- func (c *CaptchaServiceFactory) GetCache() CaptchaCacheInterface
- func (c *CaptchaServiceFactory) GetService(key string) CaptchaInterface
- func (c *CaptchaServiceFactory) RegisterCache(key string, cacheInterface CaptchaCacheInterface)
- func (c *CaptchaServiceFactory) RegisterService(key string, service CaptchaInterface)
- type ClickWordCaptchaService
- type MemCacheService
- func (l *MemCacheService) Delete(key string)
- func (l *MemCacheService) Exists(key string) bool
- func (l *MemCacheService) Get(key string) string
- func (l *MemCacheService) GetType() string
- func (l *MemCacheService) Increment(key string, val int) int
- func (l *MemCacheService) Set(key string, val string, expiresInSeconds int)
- type RedisCacheService
- func (l *RedisCacheService) Delete(key string)
- func (l *RedisCacheService) Exists(key string) bool
- func (l *RedisCacheService) Get(key string) string
- func (l *RedisCacheService) GetType() string
- func (l *RedisCacheService) Increment(key string, val int) int
- func (l *RedisCacheService) Set(key string, val string, expiresInSeconds int)
Constants ¶
View Source
const (
TEXT = "" /* 1461-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockPuzzleCaptchaService ¶
type BlockPuzzleCaptchaService struct {
// contains filtered or unexported fields
}
func NewBlockPuzzleCaptchaService ¶
func NewBlockPuzzleCaptchaService(factory *CaptchaServiceFactory) *BlockPuzzleCaptchaService
func (*BlockPuzzleCaptchaService) Check ¶
func (b *BlockPuzzleCaptchaService) Check(token string, pointJson string) error
func (*BlockPuzzleCaptchaService) Get ¶
func (b *BlockPuzzleCaptchaService) Get() (map[string]interface{}, error)
Get 获取验证码图片信息
func (*BlockPuzzleCaptchaService) Verification ¶
func (b *BlockPuzzleCaptchaService) Verification(token string, pointJson string) error
type CaptchaCacheInterface ¶
type CaptchaCacheInterface interface {
Get(key string) string
Set(key string, val string, expiresInSeconds int)
Delete(key string)
Exists(key string) bool
GetType() string
Increment(key string, val int) int
}
func NewConfigRedisCacheService ¶
func NewConfigRedisCacheService(rdsAddr []string, dbUserName, dbPassword string, enableCluster bool, db int) CaptchaCacheInterface
NewConfigRedisCacheService 初始化自定义redis配置
func NewMemCacheService ¶
func NewMemCacheService(captchaCacheMaxNumber int) CaptchaCacheInterface
type CaptchaInterface ¶
type CaptchaServiceFactory ¶
type CaptchaServiceFactory struct {
ServiceMap map[string]CaptchaInterface
ServiceLock sync.RWMutex
CacheMap map[string]CaptchaCacheInterface
CacheLock sync.RWMutex
// contains filtered or unexported fields
}
CaptchaServiceFactory 验证码服务工厂
func NewCaptchaServiceFactory ¶
func NewCaptchaServiceFactory(config *configIns.Config) *CaptchaServiceFactory
func (*CaptchaServiceFactory) GetCache ¶
func (c *CaptchaServiceFactory) GetCache() CaptchaCacheInterface
func (*CaptchaServiceFactory) GetService ¶
func (c *CaptchaServiceFactory) GetService(key string) CaptchaInterface
func (*CaptchaServiceFactory) RegisterCache ¶
func (c *CaptchaServiceFactory) RegisterCache(key string, cacheInterface CaptchaCacheInterface)
func (*CaptchaServiceFactory) RegisterService ¶
func (c *CaptchaServiceFactory) RegisterService(key string, service CaptchaInterface)
type ClickWordCaptchaService ¶
type ClickWordCaptchaService struct {
// contains filtered or unexported fields
}
func NewClickWordCaptchaService ¶
func NewClickWordCaptchaService(factory *CaptchaServiceFactory) *ClickWordCaptchaService
func (*ClickWordCaptchaService) Check ¶
func (c *ClickWordCaptchaService) Check(token string, pointJson string) error
func (*ClickWordCaptchaService) Get ¶
func (c *ClickWordCaptchaService) Get() (map[string]interface{}, error)
func (*ClickWordCaptchaService) Verification ¶
func (c *ClickWordCaptchaService) Verification(token string, pointJson string) error
type MemCacheService ¶
func (*MemCacheService) Delete ¶
func (l *MemCacheService) Delete(key string)
func (*MemCacheService) Exists ¶
func (l *MemCacheService) Exists(key string) bool
func (*MemCacheService) Get ¶
func (l *MemCacheService) Get(key string) string
func (*MemCacheService) GetType ¶
func (l *MemCacheService) GetType() string
type RedisCacheService ¶
func (*RedisCacheService) Delete ¶
func (l *RedisCacheService) Delete(key string)
func (*RedisCacheService) Exists ¶
func (l *RedisCacheService) Exists(key string) bool
func (*RedisCacheService) Get ¶
func (l *RedisCacheService) Get(key string) string
func (*RedisCacheService) GetType ¶
func (l *RedisCacheService) GetType() string
Click to show internal directories.
Click to hide internal directories.