gmailapi

package
v0.0.0-...-6774cfe Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GmailAPI

type GmailAPI struct {
	Service *gmail.Service
	Account *db.OAuthAccount
}

func Start

func Start(acct *db.OAuthAccount) (*GmailAPI, error)

Start is bullshit

func (*GmailAPI) ApplyBatch

func (g *GmailAPI) ApplyBatch(query string, batch *gmail.BatchModifyMessagesRequest) ([]string, error)

func (*GmailAPI) Archive

func (g *GmailAPI) Archive(id string) error

func (*GmailAPI) CreateFilterForGroupDelete

func (g *GmailAPI) CreateFilterForGroupDelete(groupType, val string) error

CreateFilterForGroupDelete creates a Gmail filter for the specified group type and value.

func (*GmailAPI) Delete

func (g *GmailAPI) Delete(id string) error

func (*GmailAPI) FullMessage

func (g *GmailAPI) FullMessage(id string) (*gmail.Message, error)

func (*GmailAPI) Modify

func (g *GmailAPI) Modify(id string, mod *gmail.ModifyMessageRequest) error

func (*GmailAPI) Query

func (g *GmailAPI) Query(query string) (*gmail.ListMessagesResponse, error)

func (*GmailAPI) RefreshFilters

func (g *GmailAPI) RefreshFilters() error

func (*GmailAPI) RefreshMessages

func (g *GmailAPI) RefreshMessages() ([]*gmail.Message, error)

type Message

type Message struct {
	Message   *gmail.Message
	AccountID uint
	View      models.EmailResponse
}

type MessageList

type MessageList struct {
	Messages []*Message
	API      map[uint]*GmailAPI
}

func New

func New(accounts []db.OAuthAccount) (*MessageList, error)

func (*MessageList) ApplyBatch

func (m *MessageList) ApplyBatch(accountID uint, query string, request *gmail.BatchModifyMessagesRequest) (int, error)

func (*MessageList) Archive

func (m *MessageList) Archive(id string) error

func (*MessageList) Delete

func (m *MessageList) Delete(id string) error

func (*MessageList) GetFullMessage

func (m *MessageList) GetFullMessage(id string) (*Message, error)

func (*MessageList) OpenURL

func (m *MessageList) OpenURL(id string) (string, error)

func (*MessageList) Refresh

func (m *MessageList) Refresh() error

func (*MessageList) RefreshFilters

func (m *MessageList) RefreshFilters() error

func (*MessageList) Skip

func (m *MessageList) Skip(id string)

func (*MessageList) Sort

func (m *MessageList) Sort()

Jump to

Keyboard shortcuts

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