captcha

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrExpired     = errors.New("captcha sudah kedaluwarsa, silakan minta ulang")
	ErrInvalid     = errors.New("token captcha tidak valid")
	ErrWrongAnswer = errors.New("jawaban captcha salah")
	ErrAlreadyUsed = errors.New("captcha sudah pernah dipakai, silakan minta ulang")
)

Functions

This section is empty.

Types

type Challenge

type Challenge struct {
	Token       string `json:"captcha_token"`
	ImageBase64 string `json:"captcha_image_base64"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(secret string, ttl time.Duration) *Service

func (*Service) Generate

func (s *Service) Generate() (*Challenge, error)

func (*Service) Verify

func (s *Service) Verify(token, userAnswer string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL