Documentation
¶
Overview ¶
Package metadata defines types for Gmail Takeout data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSVHeaders ¶
func CSVHeaders() []string
CSVHeaders returns the CSV column headers for email exports.
Types ¶
type EmailMessage ¶
type EmailMessage struct {
From string `json:"from"`
To []string `json:"to"`
CC []string `json:"cc"`
BCC []string `json:"bcc"`
Subject string `json:"subject"`
Date time.Time `json:"date"`
MessageID string `json:"message_id"`
InReplyTo string `json:"in_reply_to"`
ContentType string `json:"content_type"`
Labels []string `json:"labels"`
HasAttachments bool `json:"has_attachments"`
Headers map[string]string `json:"headers"`
BodyPreview string `json:"body_preview,omitempty"` // First 200 chars
}
EmailMessage represents a parsed email message from MBOX.
func ParseMboxHeader ¶
func ParseMboxHeader(headerData string) (EmailMessage, error)
ParseMboxHeader parses an email message header string into EmailMessage. Uses net/mail.ReadMessage to parse RFC 822 headers.
func (*EmailMessage) ToCSVRow ¶
func (em *EmailMessage) ToCSVRow() []string
ToCSVRow converts EmailMessage to CSV row values.
type GmailLibrary ¶
type GmailLibrary struct {
Messages []EmailMessage `json:"messages"`
MboxFiles []MboxFile `json:"mbox_files"`
}
GmailLibrary holds all parsed Gmail data.
Click to show internal directories.
Click to hide internal directories.