gmailparser

package
v0.0.0-...-545c422 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package gmailparser implements a way to parse emails.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMessageBody

func GetMessageBody(parts []*gmail.MessagePart) string

GetMessageBody finds the HTML body of an email.

func GetMessageHeader

func GetMessageHeader(headers []*gmail.MessagePartHeader, wanted string) string

GetMessageHeader goes through a list of headers and returns the header where the name matches the one we want.

func GetMessageSender

func GetMessageSender(headers []*gmail.MessagePartHeader) string

GetMessageSender goes through the headers to find the From header.

func GetMessageSubject

func GetMessageSubject(headers []*gmail.MessagePartHeader) string

GetMessageSubject goes through the headers to find the Subject header.

Types

type Email

type Email struct {
	Size    int64  `json:"size"`
	Subject string `json:"subject"`
	Body    string `json:"body"` // Base64.URLEncoding
	ID      string `json:"id"`
	Sender  string `json:"sender"`
	Date    string `json:"date"`
}

Email represents an email fetched from your gmail account.

Jump to

Keyboard shortcuts

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