Versions in this module Expand all Collapse all v0 v0.1.2 Mar 25, 2026 v0.1.1 Mar 25, 2026 Changes in this version + const OperationCapChallenge + const OperationCapRedeem + func Register(s *khttp.Server, c *Cap) + type Cap struct + func New(rdb *redis.Client) *Cap + func (c *Cap) CreateChallenge(ctx context.Context, conf *ChallengeConfig) (*ChallengeResponse, error) + func (c *Cap) RedeemChallenge(ctx context.Context, token string, solutions []int) (*RedeemResponse, error) + func (c *Cap) ValidateToken(ctx context.Context, token string) (bool, error) + type ChallengeConfig struct + ChallengeCount int + ChallengeDifficulty int + ChallengeSize int + ExpiresMs int64 + type ChallengeParams struct + C int + D int + S int + type ChallengeResponse struct + Challenge ChallengeParams + Expires int64 + Token string + type RedeemResponse struct + Expires int64 + Message string + Success bool + Token string