api

package
v0.0.0-...-ad46a6f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Export

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

Export exports Gmail filters into Gmail API objects

func Import

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

func NewLabelMap(labels []label.Label) LabelMap

NewLabelMap creates a new LabelMap given a list of labels.

func (LabelMap) AddLabel

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