api

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export added in v0.5.0

func Export(filters filter.Filters, lmap LabelMap) ([]*gmailv1.Filter, error)

Export exports Gmail filters into Gmail API objects

func Import added in v0.5.0

func Import(filters []*gmailv1.Filter, lmap LabelMap) (filter.Filters, error)

Import exports Gmail filters into Gmail API objects.

If some filter is invalid, the import skips it and returns only the valid ones, but records and returns the error in the end.

Types

type LabelMap

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

LabelMap maps label names and IDs together.

func NewLabelMap added in v0.5.0

func NewLabelMap(labels []label.Label) LabelMap

NewLabelMap creates a new LabelMap given a list of labels.

func (LabelMap) AddLabel added in v0.5.0

func (m LabelMap) AddLabel(id, name string)

AddLabel adds a label to the mapping

func (LabelMap) IDToName

func (m LabelMap) IDToName(id string) (string, bool)

IDToName maps the id of a string to its name.

func (LabelMap) NameToID

func (m LabelMap) NameToID(name string) (string, bool)

NameToID maps the name of a label to its ID.

Jump to

Keyboard shortcuts

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