gmail

package
v0.0.0-...-069b4f3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package gmail provides a gmail barista module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Threads map[string]int64
	Unread  map[string]int64
}

Info represents the unread and total thread counts for labels. The keys are the names (not IDs) of the labels, and the values are the thread counts (Threads is total threads, while Unread is just unread threads).

func (Info) TotalThreads

func (i Info) TotalThreads() int64

TotalThreads is the total number of threads across all configured labels.

func (Info) TotalUnread

func (i Info) TotalUnread() int64

TotalUnread is the total number of unread threads across all labels. (as set during construction).

type Module

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

Module represents a Gmail barista module.

func New

func New(clientConfig []byte, labels ...string) *Module

New creates a gmail module from the given oauth config, that fetches unread and total thread counts for the given set of labels.

func (*Module) Output

func (m *Module) Output(outputFunc func(Info) bar.Output) *Module

Output sets the output format for the module.

func (*Module) RefreshInterval

func (m *Module) RefreshInterval(interval time.Duration) *Module

RefreshInterval sets the interval between consecutive checks for new mail.

func (*Module) Stream

func (m *Module) Stream(sink bar.Sink)

Stream starts the module.

Jump to

Keyboard shortcuts

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