Documentation
¶
Index ¶
Constants ¶
const LeaseTime = 60 * time.Second
LeaseTime is the duration for which a function execution holds the lease to prevent duplicate emails.
const Region string = "your-region"
Region is the region where your Cloud Functions are deployed.
Variables ¶
This section is empty.
Functions ¶
func IsEmailAddressFormatValid ¶
IsEmailAddressFormatValid checks if a string is a valid RFC 822 email address, with caveats. Returns nil error if valid, and an error with a reason if invalid. RFC 822 is a very old standard. This attempts to cover the core requirements, but is not a perfect implementation. For complete validation, use a dedicated email validation library/package, or a more thorough approach such as parsing the email using the `mail` package and validating parts.
This uses `net/mail.ParseAddress`, which is a more robust base, and then applies a regex and checks length and content.
Types ¶
This section is empty.