user/pkg/captcha/interface.go
timerzz e7e3309896 优化Docker构建流程
- 添加UPX压缩步骤减小可执行文件体积
- 使用多阶段构建减小最终镜像大小
- 更新基础镜像到最新版本
2025-04-22 17:30:36 +08:00

27 lines
591 B
Go

package captcha
import (
"context"
"errors"
"time"
)
var (
ErrCodeSendTooMany = errors.New("发送验证码太频繁")
ErrCodeVerifyFail = errors.New("验证码错误")
)
// Service 发送和验证验证码
type Service interface {
SendCode(ctx context.Context, phone string) error
VerifyCode(ctx context.Context, phone, code string) error
Close() error
}
type Store interface {
Set(ctx context.Context, key string, value string, timeout time.Duration) error
Get(ctx context.Context, key string) (string, error)
Delete(ctx context.Context, key string) error
Close() error
}