Documentation
¶
Index ¶
- Variables
- func Archive(id string) error
- func CreateDraft(opts MessageOptions) (string, error)
- func DeleteDraft(id string) error
- func ExtractBody(msg *gmail.Message) string
- func ExtractHeader(msg *gmail.Message, name string) string
- func GetAllRecipients(msg *gmail.Message) (to string, cc string)
- func GetDraft(id string) (*gmail.Draft, error)
- func GetLastMessageInThread(threadID string) (*gmail.Message, error)
- func GetOriginalMessageID(msg *gmail.Message) string
- func GetReferences(msg *gmail.Message) string
- func GetSignature(sendAsEmail string) (string, error)
- func GetThread(id string) (*gmail.Thread, error)
- func GetThreadMetadata(ctx context.Context, id string) (*gmail.Thread, error)
- func HTMLText(s string) string
- func Init(client *http.Client) error
- func MarkRead(id string) error
- func MarkSpam(id string) error
- func MarkUnread(id string) error
- func SendDraft(id string) (threadID string, err error)
- func SendMessage(opts MessageOptions) (threadID string, err error)
- func Star(id string) error
- func StripQuotedText(body string) string
- func Trash(id string) error
- func Unstar(id string) error
- func UpdateDraft(id string, opts MessageOptions) error
- type Attachment
- type DraftOverlay
- type DraftSummary
- type MessageOptions
- func ApplyDraftOverlay(base MessageOptions, ov DraftOverlay) MessageOptions
- func BuildForwardOptions(threadID string, to []string, note string, contentType string, ...) (MessageOptions, error)
- func BuildReplyOptions(threadID string, body string, contentType string, replyAll bool, ...) (MessageOptions, error)
- func DraftToOptions(d *gmail.Draft) (MessageOptions, error)
- type ThreadSummary
Constants ¶
This section is empty.
Variables ¶
View Source
var Service *gmail.Service
Functions ¶
func CreateDraft ¶ added in v1.1.4
func CreateDraft(opts MessageOptions) (string, error)
func DeleteDraft ¶ added in v1.1.4
func ExtractBody ¶
func GetOriginalMessageID ¶
func GetReferences ¶
func GetSignature ¶
func GetThreadMetadata ¶
func HTMLText ¶ added in v1.1.4
Unescaped plain text spliced into an HTML body loses every line break, and any markup-shaped run (a bare "<bob@x.com>") is swallowed.
func MarkUnread ¶
func SendMessage ¶
func SendMessage(opts MessageOptions) (threadID string, err error)
func StripQuotedText ¶ added in v1.1.4
func UpdateDraft ¶ added in v1.1.4
func UpdateDraft(id string, opts MessageOptions) error
Types ¶
type Attachment ¶ added in v1.1.4
func LoadAttachments ¶ added in v1.1.4
func LoadAttachments(paths []string) ([]Attachment, error)
type DraftOverlay ¶ added in v1.1.4
type DraftOverlay struct {
To *[]string
Cc *[]string
Bcc *[]string
Subject *string
Body *string
ContentType *string
AppendAttachments []Attachment
}
DraftOverlay is a proposed draft edit: a nil field carries the base value forward, a non-nil field replaces it (a non-nil pointer to an empty value clears the field — the "-s \"\" clears vs omitted carries forward" rule). AppendAttachments are always added to the base's carried attachments.
type DraftSummary ¶ added in v1.1.4
func ListDrafts ¶ added in v1.1.4
func ListDrafts(ctx context.Context, limit int64) ([]DraftSummary, error)
type MessageOptions ¶
type MessageOptions struct {
To []string
Cc []string
Bcc []string
Subject string
Body string
ContentType string
InReplyTo string
References string
ThreadId string
Attachments []Attachment
}
func ApplyDraftOverlay ¶ added in v1.1.4
func ApplyDraftOverlay(base MessageOptions, ov DraftOverlay) MessageOptions
func BuildForwardOptions ¶ added in v1.1.4
func BuildForwardOptions(threadID string, to []string, note string, contentType string, extraAttachments []Attachment) (MessageOptions, error)
func BuildReplyOptions ¶ added in v1.1.4
func BuildReplyOptions(threadID string, body string, contentType string, replyAll bool, attachments []Attachment) (MessageOptions, error)
func DraftToOptions ¶ added in v1.1.4
func DraftToOptions(d *gmail.Draft) (MessageOptions, error)
The body is normalized to plain text so draft-edit re-composes as text/plain.
type ThreadSummary ¶
type ThreadSummary struct {
ID string
From string
Subject string
Date string
Snippet string
Unread bool
MessageCount int
}
func ListThreads ¶
func SearchThreads ¶
Click to show internal directories.
Click to hide internal directories.