Documentation
¶
Overview ¶
Package message_text reads a Gmail message as text: its text/plain part, or, failing one, its text/html part read by a reader of HTML the caller gives, as github.com/altshiftab/html_text's Text.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindTextPart ¶
func FindTextPart(part *message_part.MessagePart, mimeType string) *message_part.MessagePart
FindTextPart returns the first part of the mime type that is text rather than an attachment, searching the parts in the order they appear. A message that is not multipart is its own single part.
func Text ¶
Text is the text of the message: its text/plain part, or, failing one, its text/html part read as text by htmlToText, which also reads a text/plain part that is an HTML document in fact, as some senders' are. A message with neither -- an image, a calendar invitation with no description -- has none, and nor has one of HTML alone when htmlToText is nil. A text/plain part keeps its indentation and its runs of spaces, which line its columns up.
Gmail serves a part's data in the message's own character set, which for mail is overwhelmingly UTF-8; what is not valid UTF-8 is read as Latin-1, which is right for the rest of what arrives and readable for anything else.
Types ¶
This section is empty.