barista.run: barista.run/modules/gsuite/gmail Index | Files

package gmail

import "barista.run/modules/gsuite/gmail"

Package gmail provides a gmail barista module.

Index

Package Files

gmail.go

type Info Uses

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 Uses

func (i Info) TotalThreads() int64

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

func (Info) TotalUnread Uses

func (i Info) TotalUnread() int64

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

type Module Uses

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

Module represents a Gmail barista module.

func New Uses

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 Uses

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

Output sets the output format for the module.

func (*Module) RefreshInterval Uses

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

RefreshInterval sets the interval between consecutive checks for new mail.

func (*Module) Stream Uses

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

Stream starts the module.

Package gmail imports 9 packages (graph) and is imported by 2 packages. Updated 2018-11-20. Refresh now. Tools for package owners.