Add HTTP /v1 MVC, TCP send path, groups with server-side member-avatar collage, object-storage upload, and friends/favorites around the architecture-v3 layout. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
459 B
Go
25 lines
459 B
Go
package entity
|
|
|
|
import (
|
|
"regexp"
|
|
"strings"
|
|
"time"
|
|
)
|
|
|
|
var testEmailRe = regexp.MustCompile(`^test(0[1-9]|10)@spark\.com$`)
|
|
|
|
// EmailBinding maps one normalized email to one user.
|
|
type EmailBinding struct {
|
|
Email string
|
|
UserID int64
|
|
CreatedAt time.Time
|
|
}
|
|
|
|
func NormalizeEmail(email string) string {
|
|
return strings.ToLower(strings.TrimSpace(email))
|
|
}
|
|
|
|
func IsTestEmail(email string) bool {
|
|
return testEmailRe.MatchString(NormalizeEmail(email))
|
|
}
|