Documentation
¶
Index ¶
Constants ¶
const Version = "v1alpha2"
Version is the latest supported version.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actions ¶
type Actions struct { Archive bool `yaml:"archive,omitempty"` Delete bool `yaml:"delete,omitempty"` MarkRead bool `yaml:"markRead,omitempty"` Star bool `yaml:"star,omitempty"` // MarkSpam can be used to disallow mails to be marked as spam. // This however is not allowed to be set to true by Gmail. MarkSpam *bool `yaml:"markSpam,omitempty"` MarkImportant *bool `yaml:"markImportant,omitempty"` Category gmail.Category `yaml:"category,omitempty"` Labels []string `yaml:"labels,omitempty"` }
Actions contains the actions to be applied to a set of emails.
type Config ¶
type Config struct { Version string `yaml:"version"` Author Author `yaml:"author,omitempty"` Filters []NamedFilter `yaml:"filters,omitempty"` Rules []Rule `yaml:"rules"` }
Config contains the yaml configuration of the Gmail filters.
type FilterNode ¶
type FilterNode struct { RefName string `yaml:"name,omitempty"` And []FilterNode `yaml:"and,omitempty"` Or []FilterNode `yaml:"or,omitempty"` Not *FilterNode `yaml:"not,omitempty"` From string `yaml:"from,omitempty"` To string `yaml:"to,omitempty"` Cc string `yaml:"cc,omitempty"` Subject string `yaml:"subject,omitempty"` List string `yaml:"list,omitempty"` Has string `yaml:"has,omitempty"` Query string `yaml:"query,omitempty"` }
FilterNode represents a piece of a Gmail filter.
The definition is recursive, as filters can be composed together with the use of logical operators. For every filter node, only one operator can be specified. If you need to combine multiple queries together, combine the nodes with 'And', 'Or' and 'Not'.
func (FilterNode) Empty ¶
func (f FilterNode) Empty() bool
Empty returns true if all the fields are empty.
func (FilterNode) NonEmptyFields ¶
func (f FilterNode) NonEmptyFields() []string
NonEmptyFields returns the names of the fields with a value.
func (FilterNode) String ¶
func (f FilterNode) String() string
type NamedFilter ¶
type NamedFilter struct { Name string `yaml:"name"` Query FilterNode `yaml:"query"` }
NamedFilter represents a filter with a name.
A named filter can be referenced by other named filters and by filters inside rules.