parse

package
v0.1.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Email

type Email struct {
	Raw           string // the original, trimmed input
	Local         string // the part before @
	Domain        string // the part after @, ASCII/Punycode form (for DNS/SMTP)
	DomainUnicode string // the part after @, Unicode form (for display/typo detection)
	Valid         bool   // false if Raw cannot be parsed
}

Email is the internal representation of a parsed email address. The check/ packages receive this as parameter.

func NewEmail

func NewEmail(raw string) Email

NewEmail attempts to parse the given email string. If parsing fails, Valid=false but Raw is always populated. Supports internationalized email addresses (RFC 6531 / EAI) and internationalized domain names (IDNA2008).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL