gmailstats

package module
v0.0.0-...-857530e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package gmailstats offers a collection of facilities to interact with Google Gmail API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetMessagesCall

type GetMessagesCall struct {
	// contains filtered or unexported fields
}

func (*GetMessagesCall) Append

func (g *GetMessagesCall) Append() *GetMessagesCall

func (*GetMessagesCall) Do

func (g *GetMessagesCall) Do(numCPU int) *GmailStats

func (*GetMessagesCall) Write

func (g *GetMessagesCall) Write() *GetMessagesCall

type GmailStats

type GmailStats struct {
	MessageIds   []*MessageId
	Messages     []*Message
	MessagesFile *os.File
	// contains filtered or unexported fields
}

func New

func New() *GmailStats

New creates a GmailStats instance with a service object ready to make API calls.

func (*GmailStats) GetMessages

func (gs *GmailStats) GetMessages() *GetMessagesCall

func (*GmailStats) ListMessages

func (gs *GmailStats) ListMessages() *ListMessagesCall

ListMessages lists a number of messages and store their message ids and thread ids in the calling GmailStats instance. The default number of messages retrieved is 100. Chat messages are excluded.

func (*GmailStats) OpenMessagesFile

func (gs *GmailStats) OpenMessagesFile(filename string)

type ListMessagesCall

type ListMessagesCall struct {
	// contains filtered or unexported fields
}

func (*ListMessagesCall) Do

func (l *ListMessagesCall) Do() (*GmailStats, error)

Do executes the ListMessagesCall and stores the retrieved messages in the MessageIds field of the calling GmailStats instance.

func (*ListMessagesCall) MaxResults

func (l *ListMessagesCall) MaxResults(maxResults int64) *ListMessagesCall

MaxResults modifies the ListMessagesCall to retrieve a particular number of messages specified.

func (*ListMessagesCall) Q

Q modifies the ListMessagesCall to only search for messages that match the provided query string.

type Message

type Message struct {
	Id     *MessageId     `json:"id"`
	Time   *MessageTime   `json:"time",omitempty`
	Header *MessageHeader `json:"header",omitempty`
	Text   *MessageText   `json:"text",omitempty`
}

type MessageHeader

type MessageHeader struct {
	FromEmail   string   `json:"fromemail",omitempty`
	ToEmails    []string `json:"toemails",omitempty`
	CcEmails    []string `json:"ccemails,omitempty"`
	BccEmails   []string `json:"bccemails,omitempty"`
	MailingList string   `json:"mailinglist",omitempty`
}

type MessageId

type MessageId struct {
	MessageId string `json:"messageid"`
	ThreadId  string `json:"threadid",omitempty`
}

type MessageText

type MessageText struct {
	Subject  string `json:"subject",omitempty`
	Snippet  string `json:"snippet",omitempty`
	BodyText string `json:"bodytext",omitempty`
}

type MessageTime

type MessageTime struct {
	Time int64 `json:"time",omitempty`
}

Jump to

Keyboard shortcuts

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