metadata

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2026 License: GPL-3.0 Imports: 4 Imported by: 0

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.

type MboxFile

type MboxFile struct {
	Path         string `json:"path"`
	Label        string `json:"label"`
	MessageCount int    `json:"message_count"`
}

MboxFile represents an MBOX file metadata.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL