Initial sanitized code sync

This commit is contained in:
zqq61
2026-03-15 20:48:19 +08:00
commit 17ee51ba04
126 changed files with 22546 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
package email
import (
"context"
"time"
)
// EmailProvider is the pluggable interface for email services.
type EmailProvider interface {
// CreateMailbox creates a temporary mailbox, returning the email address and an internal ID.
CreateMailbox(ctx context.Context) (email string, mailboxID string, err error)
// WaitForVerificationCode polls for an OTP email and extracts the verification code.
// notBefore: only consider emails received after this time (use time.Time{} to accept all).
WaitForVerificationCode(ctx context.Context, mailboxID string, timeout time.Duration, notBefore time.Time) (code string, err error)
// WaitForTeamAccountID polls for a Team workspace creation email from OpenAI
// and extracts the account_id from the embedded link (direct URL or Mandrill tracking link).
// notBefore: only consider emails received after this time.
WaitForTeamAccountID(ctx context.Context, mailboxID string, timeout time.Duration, notBefore time.Time) (accountID string, err error)
}