Files
xiaolajiaoyyds 6f71df4849 Initial open-source release
多平台账号批量注册系统,支持 OpenAI / Grok / Kiro / Gemini 平台的全自动注册。

Features:
- 用户名/密码注册登录(首个用户自动管理员)
- JWT 认证 + bcrypt 密码加密
- 积分系统与多用户管理
- HuggingFace Space 弹性 Worker 节点管理
- Cloudflare Worker 负载均衡
- 实时日志推送(SSE/WebSocket)
- 管理后台(用户管理、系统设置、代理池、卡池)

Tech Stack: Go 1.25 / Gin / GORM / PostgreSQL / Vue 3 / Vite / TailwindCSS
2026-03-22 03:44:42 +08:00

30 lines
1.1 KiB
Go
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package tempmail
import (
"context"
"errors"
"time"
)
// ErrRateLimited 表示邮箱服务返回 429(速率限制)
var ErrRateLimited = errors.New("邮箱服务速率限制 (429)")
// ErrAuthFailed 表示邮箱服务认证失败(401/403,API Key 无效)
var ErrAuthFailed = errors.New("邮箱服务认证失败 (401/403)")
// EmailProvider 临时邮箱服务提供者接口
// meta 用于携带 provider 特有的状态(如 Mail.tm 的 JWT token、Guerrilla Mail 的 sid_token、tempmail.lol 的 token)
type EmailProvider interface {
// Name 返回 provider 唯一标识(如 "yydsmail")
Name() string
// GenerateEmail 创建一个临时邮箱,返回邮箱地址和 provider 元数据
GenerateEmail(ctx context.Context) (addr string, meta map[string]string, err error)
// FetchVerificationCode 从邮箱中提取验证码
FetchVerificationCode(ctx context.Context, addr string, meta map[string]string, maxAttempts int, interval time.Duration) (string, error)
// DeleteEmail 删除/清理临时邮箱(非关键步骤,失败不影响主流程)
DeleteEmail(ctx context.Context, addr string, meta map[string]string) error
}