Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func VerifyCaptcha ¶
Types ¶
type CaptchaType ¶
type CaptchaType string
const ( CaptchaTypeLocal CaptchaType = "local" CaptchaTypeTurnstile CaptchaType = "turnstile" CaptchaTypeSlider CaptchaType = "slider" )
type Config ¶
type Config struct {
Type CaptchaType
RedisClient *redis.Client
TurnstileSecret string
}
type Service ¶
type Service interface {
Generate(ctx context.Context) (id string, image string, err error)
Verify(ctx context.Context, token string, code string, ip string) (bool, error)
GetType() CaptchaType
}
func NewService ¶
type SliderService ¶
type SliderService interface {
Service
GenerateSlider(ctx context.Context) (id string, bgImage string, blockImage string, err error)
VerifySlider(ctx context.Context, id string, x, y int, trail string) (token string, err error)
VerifySliderToken(ctx context.Context, token string) (bool, error)
}
func NewSliderService ¶
func NewSliderService(redisClient *redis.Client) SliderService
type TrailPoint ¶
Click to show internal directories.
Click to hide internal directories.