Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrCodeRepeated = errors.New("code repeated")
)
Functions ¶
This section is empty.
Types ¶
type CaptchaCache ¶
type CaptchaCache interface { // Set storage code into cache with ttl, return false if retry failed. Set(ctx context.Context, usage types.Usage, code, to string, ttl, retry time.Duration) (bool, error) // Get returns the specified code Get(ctx context.Context, usage types.Usage, code string) (string, error) // Del remove the specified code from cache Del(ctx context.Context, usage types.Usage, code string) error }
CaptchaCache is responsible for storing captcha code into cache
type RedisCaptchaCache ¶
type RedisCaptchaCache struct {
// contains filtered or unexported fields
}
RedisCaptchaCache implements CaptchaCache with redis cache
func NewRedisCaptchaCache ¶
func NewRedisCaptchaCache(cache *redis.Client) *RedisCaptchaCache
Click to show internal directories.
Click to hide internal directories.