package
0.0.0-20220105211316-2b86a76c0730
Repository: https://github.com/zostay/go-addr.git
Documentation: pkg.go.dev
# Packages
Package encoding defines a custom CharsetReader for expanding the encodings that are available for the MIME word decoders used when parsing email addresses.
# Functions
ApplyActions is a low-level function that can be used to transform an rd.Match object returned by the Parser into a high-level address object.
NewAddrSpec creates a new AddrSpec object from the given local part and domain.
NewAddrSpecParsed creates a new AddrSpec object from the given local part and domain and stores an originally parsed string for roundtripping.
NewGroupParsed constructs and returns a group email address with an associated original string.
NewMailbox will construct a new mailbox from the given display name, AddrSpec, and comment.
NewMailboxParsed will construct a new mailbox from the given display name, AddrSpec, and comment, and will provide the given original as the originally parsed string.
NewMailboxStr is identical in operation to NewMailbox except that it takes the addrSpec argument as a string.
ParseEmailAddress will parse any single email address.
ParseEmailAddressList will parse any list of addresses.
ParseEmailAddrSpec parses the given email string for a bare email.
ParseEmailGroup parses the string as a group email address and returns the group found.
ParseEmailMailbox parses the email mailbox string.
ParseEmailMailboxList parses a list of mailbox email addresses.
# Variables
CharsetReader is used to help perform MIME word decoding.
ErrCommentUnbalancedLeft error is returned when constructing a mailbox and the comment given contains too many left parentheses.
ErrCommentUnbalancedRight error is returned when constructing a mailbox and the comment given contains too many right parentheses.
ErrParse indicates that the parser was unable to match the given input.
ErrParseConstruction indicates that the parser was able to match the string, but that object does not produce any output for construction.
ErrTypeMismatch indicates that the parser was able to match the string, but the type of object produced by that match does not match the pointer provided as the second argument to ApplyActions.
ErrTypeUnknown indicates that the parser was able to match the string, but then the ApplyActions routine produced an object that it has not been written to handle.
# Structs
AddrSpec is a concrete type for holding a single email address with no metadata.
Group is the concrete object for holding a named group of email addresses.
Mailbox is a concrete type for storing a mailbox email address.
PartialParseError is returned when one of the Parse functions is able to parse a value out from the start of the string, but was unable to match the entire string.
# Interfaces
Address represents a generic email address.
# Type aliases
AddressList is a slice of Address objects.
MailboxList is a slice of mailbox pointers.