21 lines
544 B
Go
21 lines
544 B
Go
package ports
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
// VerificationCodeData represents verification code data
|
|
type VerificationCodeData struct {
|
|
Code string
|
|
Attempts int
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
// EmailCache defines cache operations for email service
|
|
type EmailCache interface {
|
|
GetVerificationCode(ctx context.Context, email string) (*VerificationCodeData, error)
|
|
SetVerificationCode(ctx context.Context, email string, data *VerificationCodeData, ttl time.Duration) error
|
|
DeleteVerificationCode(ctx context.Context, email string) error
|
|
}
|