Documentation ¶
Index ¶
- func CombineParts(parts []Part) (text string, err error)
- func GetInlineText(r io.Reader) (text string, err error)
- func GetMessageType(message *mail.Message) (mediatype string, params map[string]string, err error)
- func GetMultipartReader(r io.Reader) (*multipart.Reader, error)
- func GetPartContent(part multipart.Part) (content []byte)
- func GetPartDisposition(part *multipart.Part) string
- func GetPartType(part *multipart.Part) string
- func IsAttachment(part *multipart.Part) bool
- func IsHtmlPart(part *multipart.Part) bool
- func IsInlineTextPart(part *multipart.Part) bool
- func IsPlainTextPart(part *multipart.Part) bool
- func IsTextPart(part *multipart.Part) bool
- type MultipartFindFunc
- type Part
- func FindParts(r *multipart.Reader, findFunc MultipartFindFunc) (parts []Part, err error)
- func GetAllParts(r io.Reader) ([]Part, error)
- func GetAttachments(r io.Reader) ([]Part, error)
- func GetHtmlParts(r io.Reader) ([]Part, error)
- func GetParts(r io.Reader, findFunc MultipartFindFunc) ([]Part, error)
- func GetPlainTextParts(r io.Reader) ([]Part, error)
- func GetTextParts(r io.Reader) ([]Part, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineParts ¶
CombineParts returns the body of each part, concatenated and separated by new lines
func GetMessageType ¶
GetMessageType returns the media type and params from a mail.Message
func GetMultipartReader ¶
GetMultipartReader returns a multipart.Reader from an io.Reader
Returns an error if the io.Reader does not contain an email or if it is not a multipart email
func GetPartContent ¶
GetPartContent returns the content (body) of a multipart.Part
func GetPartDisposition ¶
GetPartDisposition returns the Content-Disposition media type
If the header is not set, an empty string is returned
func GetPartType ¶
GetPartType returns the media type from a multipart.Part
func IsAttachment ¶
IsAttachment returns true if the part disposition starts with attachment
Implements MultipartFindFunc
func IsInlineTextPart ¶
IsInlineTextPart returns true for text parts that are not attachments
Implements MultipartFindFunc
func IsPlainTextPart ¶
IsPlainTextPart returns true for text/plain media types
Implements MultipartFindFunc
Types ¶
type MultipartFindFunc ¶
MultipartFindFunc is used to filter parts
Returns true if the part should be included, and false if it should be filtered out
type Part ¶
Part is a multipart.Part and its Content
func FindParts ¶
func FindParts(r *multipart.Reader, findFunc MultipartFindFunc) (parts []Part, err error)
FindParts returns a list of Parts for which findFunc returns true
func GetAllParts ¶
GetAllParts returns a list of all Parts
func GetAttachments ¶
GetAttachments returns a list of Parts that are attachments
func GetHtmlParts ¶
GetHtmlParts returns a list of Parts that are text/html
func GetParts ¶
func GetParts(r io.Reader, findFunc MultipartFindFunc) ([]Part, error)
GetParts converts an io.Reader to a multipart.Reader and calls FindParts
func GetPlainTextParts ¶
GetPlainTextParts returns a list of Parts that are text/plain