Documentation ¶
Overview ¶
Package rfc5322 is a parser for RFC 5322 email addresses.
Index ¶
- Constants
- func MatchAText(cs []byte) (*rd.Match, []byte)
- func MatchAddrSpec(cs []byte) (*rd.Match, []byte)
- func MatchAddress(cs []byte) (*rd.Match, []byte)
- func MatchAddressList(cs []byte) (*rd.Match, []byte)
- func MatchAngleAddr(cs []byte) (*rd.Match, []byte)
- func MatchAtom(cs []byte) (*rd.Match, []byte)
- func MatchCContent(cs []byte) (*rd.Match, []byte)
- func MatchCFWS(cs []byte) (*rd.Match, []byte)
- func MatchCRLF(cs []byte) (*rd.Match, []byte)
- func MatchCText(cs []byte) (*rd.Match, []byte)
- func MatchComment(cs []byte) (*rd.Match, []byte)
- func MatchDText(cs []byte) (*rd.Match, []byte)
- func MatchDisplayName(cs []byte) (*rd.Match, []byte)
- func MatchDomain(cs []byte) (*rd.Match, []byte)
- func MatchDomainLiteral(cs []byte) (*rd.Match, []byte)
- func MatchDotAtom(cs []byte) (*rd.Match, []byte)
- func MatchDotAtomText(cs []byte) (*rd.Match, []byte)
- func MatchFWS(cs []byte) (*rd.Match, []byte)
- func MatchGroup(cs []byte) (*rd.Match, []byte)
- func MatchGroupList(cs []byte) (*rd.Match, []byte)
- func MatchLocalPart(cs []byte) (*rd.Match, []byte)
- func MatchMailbox(cs []byte) (*rd.Match, []byte)
- func MatchMailboxList(cs []byte) (*rd.Match, []byte)
- func MatchNameAddr(cs []byte) (*rd.Match, []byte)
- func MatchObsAddrList(cs []byte) (*rd.Match, []byte)
- func MatchObsAngleAddr(cs []byte) (*rd.Match, []byte)
- func MatchObsCText(cs []byte) (*rd.Match, []byte)
- func MatchObsDText(cs []byte) (*rd.Match, []byte)
- func MatchObsDomain(cs []byte) (*rd.Match, []byte)
- func MatchObsDomainList(cs []byte) (*rd.Match, []byte)
- func MatchObsFWS(cs []byte) (*rd.Match, []byte)
- func MatchObsGroupList(cs []byte) (*rd.Match, []byte)
- func MatchObsLocalPart(cs []byte) (*rd.Match, []byte)
- func MatchObsMboxList(cs []byte) (*rd.Match, []byte)
- func MatchObsNoWSCtl(cs []byte) (*rd.Match, []byte)
- func MatchObsPhrase(cs []byte) (*rd.Match, []byte)
- func MatchObsQP(cs []byte) (*rd.Match, []byte)
- func MatchObsQText(cs []byte) (*rd.Match, []byte)
- func MatchObsRoute(cs []byte) (*rd.Match, []byte)
- func MatchPhrase(cs []byte) (*rd.Match, []byte)
- func MatchQContent(cs []byte) (*rd.Match, []byte)
- func MatchQText(cs []byte) (*rd.Match, []byte)
- func MatchQuotedPair(cs []byte) (*rd.Match, []byte)
- func MatchQuotedString(cs []byte) (*rd.Match, []byte)
- func MatchWord(cs []byte) (*rd.Match, []byte)
Constants ¶
const ( TMailboxList rd.ATag = rd.TLast + iota TNameAddr TAngleAddr TGroup TDisplayName TAddressList TAddrSpec TWords TAtom TDotAtom TCText TCContents TComment TQuotedString TObsQP TObsAngleAddr TObsRoute TObsDomainList TObsMboxList TObsAddrList TObsGroupList TObsLocalPart TObsDomain TObsMboxTailList TObsMboxOptionalList TObsAddrTailList TObsAddrOptionalList TObsDomainTailList TObsDomainOptionalList )
Tags for RFC 5322 parser matches.
Variables ¶
This section is empty.
Functions ¶
func MatchAText ¶
MatchAText matches a single atom character.
// atext = ALPHA / DIGIT / ; Printable US-ASCII // "!" / "#" / ; characters not including // "\$" / "%" / ; specials. Used for atoms. // "&" / "'" / // "*" / "+" / // "-" / "/" / // "=" / "?" / // "^" / "_" / // "`" / "{" / // "|" / "}" / // "~"
func MatchAddrSpec ¶
MatchAddrSpec matches a bare email address.
// addr-spec = local-part "@" domain
func MatchAddressList ¶
MatchAddressList matches one more more addresses, which includes eiether mailboxes or groups, separated by commas.
// address-list = (address *("," address)) / obs-addr-list
func MatchAngleAddr ¶
MatchAngleAddr matches a single angle address.
// angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / // obs-angle-addr
func MatchCContent ¶
MatchCContent matches the content inside of a comment.
// ccontent = ctext / quoted-pair / comment
func MatchCFWS ¶
MatchCFWS matches folding whitespace that may contain comments.
// CFWS = (1*([FWS] comment) [FWS]) / FWS
func MatchCRLF ¶
MatchCRLF matches any sensible kind of line ending thing.
// CRLF = CR LF / CR / LF
func MatchCText ¶
MatchCText matches a single character permitted in a comment.
// ctext = %d33-39 / ; Printable US-ASCII // %d42-91 / ; characters not including // %d93-126 / ; "(", ")", or "\" // obs-ctext
func MatchComment ¶
MatchComment matches a email comment.
// comment = "(" *([FWS] ccontent) [FWS] ")"
func MatchDText ¶
MatchDText matches a single character valid for use in a domain literal.
// dtext = %d33-90 / ; Printable US-ASCII // %d94-126 / ; characters not including // obs-dtext ; "[", "]", or "\\"
func MatchDomain ¶
MatchDomain matches the part of the email after the at-sign.
// domain = dot-atom / domain-literal / obs-domain
func MatchDomainLiteral ¶
MatchDomainLiteral domain literals in email addresses.
// domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]
func MatchDotAtom ¶
MatchDotAtom matches a complete dot atom list bookended by whitespace and comments.
// dot-atom = [CFWS] dot-atom-text [CFWS]
func MatchDotAtomText ¶
MatchDotAtomText matches a list of atoms connected by periods.
// dot-atom-text = 1*atext *("." 1*atext)
func MatchFWS ¶
MatchFWS matches folding whitespace.
// FWS = ([*WSP CRLF] 1*WSP) / obs-FWS // ; Folding white space
func MatchGroup ¶
MatchGroup matches a single group address. A group address is a list of mailbox addresses prefixed with a name and ended with a semi-colon.
// group = display-name ":" [group-list] ";" [CFWS]
func MatchGroupList ¶
MatchGroupList matches mailboxes that are permitted within an address group.
// group-list = mailbox-list / CFWS / obs-group-list
func MatchLocalPart ¶
MatchLocalPart matches the part of the email address before the at-sign.
// local-part = dot-atom / quoted-string / obs-local-part
func MatchMailbox ¶
MatchMailbox matches a single mailbox email address. This is a complete email address with display name or a bare address.
// mailbox = name-addr / addr-spec
func MatchMailboxList ¶
MatchMailboxList matches one or more mailboxes (groups are not permitted) separated by commas.
// mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
func MatchNameAddr ¶
MatchNameAddr matches a single mailbox address, but only those that have a display name followed by angle address.
// name-addr = [display-name] angle-addr
func MatchObsAddrList ¶
MatchObsAddrList matches an obsolete list of addresses.
// obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])
func MatchObsAngleAddr ¶
MatchObsAngleAddr matches an obsolete angle address.
// obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]
func MatchObsCText ¶
MatchObsCText matches a single character for a obsolete comment.
// obs-ctext = obs-NO-WS-CTL
func MatchObsDText ¶
MatchObsDText matches a single obsolete character.
// obs-dtext = obs-NO-WS-CTL / quoted-pair
func MatchObsDomain ¶
MatchObsDomain matches an obsolete domain part.
// obs-domain = atom *("." atom)
func MatchObsDomainList ¶
MatchObsDomainList matches a list of domains for obsolete email addresses.
// obs-domain-list = *(CFWS / ",") "@" domain // *("," [CFWS] ["@" domain])
func MatchObsFWS ¶
MatchObsFWS matches parts of folding whitespace taht is no longer permitted.
// obs-FWS = 1*WSP *(CRLF 1*WSP)
func MatchObsGroupList ¶
MatchObsGroupList matches obsolete list of mailboxes for use in a group (in this case, allows empty mailboxes lists to match).
// obs-group-list = 1*([CFWS] ",") [CFWS]
func MatchObsLocalPart ¶
MatchObsLocalPart matches an obsolete local part.
// obs-local-part = word *("." word)
func MatchObsMboxList ¶
MatchObsMboxList matches an obsolete list of mailboxes.
// obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])
func MatchObsNoWSCtl ¶
MatchObsNoWSCtl matches a single character for various obsolete productions.
// obs-NO-WS-CTL = %d1-8 / ; US-ASCII control // %d11 / ; characters that do not // %d12 / ; include the carriage // %d14-31 / ; return, line feed, and // %d127 ; white space characters
func MatchObsPhrase ¶
MatchObsPhrase matches an obsolete phrase.
// obs-phrase = word *(word / "." / CFWS)
func MatchObsQP ¶
MatchObsQP matches a quoted pair for obsolete matches.
// obs-qp = "\\" (%d0 / obs-NO-WS-CTL / LF / CR)
func MatchObsQText ¶
MatchObsQText matches a single character for obsolete quoted string.
// obs-qtext = obs-NO-WS-CTL
func MatchObsRoute ¶
MatchObsRoute matches a source route, which is an obsolete email address feature.
// obs-route = obs-domain-list ":"
func MatchQContent ¶
MatchQContent matches the content inside of a quoted string.
// qcontent = qtext / quoted-pair
func MatchQText ¶
MatchQText matches characters valid within a quoted string.
// qtext = %d33 / ; Printable US-ASCII // %d35-91 / ; characters not including // %d93-126 / ; "\" or the quote character // obs-qtext
func MatchQuotedPair ¶
MatchQuotedPair matches a quoted pair for use in email addresses.
// quoted-pair = ("\\" (VCHAR / WSP)) / obs-qp
func MatchQuotedString ¶
MatchQuotedString matches a complete quoted string.
// quoted-string = [CFWS] // DQUOTE *([FWS] qcontent) [FWS] DQUOTE // [CFWS]
Types ¶
This section is empty.