Documentation
¶
Index ¶
Constants ¶
const Version = "v1alpha1"
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"`
MarkImportant bool `yaml:"markImportant,omitempty"`
MarkRead bool `yaml:"markRead,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 CompositeFilters ¶
type CompositeFilters struct {
MatchFilters `yaml:",inline"`
Not MatchFilters `yaml:"not"`
}
CompositeFilters contains alternatively match or negation of matches.
All the conditions are put in AND together.
type Config ¶
type Config struct {
Version string `yaml:"version"`
Author Author `yaml:"author"`
Consts Consts `yaml:"consts,omitempty"`
Rules []Rule `yaml:"rules"`
}
Config contains the yaml configuration of the Gmail filters.
func ResolveConsts ¶
ResolveConsts returns a copy of the config with all the constants replaced in the filters.
type ConstValue ¶
type ConstValue struct {
Values []string `yaml:"values"`
}
ConstValue is a container for an array of string values.
type Filters ¶
type Filters struct {
CompositeFilters `yaml:",inline"`
Consts CompositeFilters `yaml:"consts"`
Query string `yaml:"query"`
}
Filters determine how to select emails.
Two ways are possible: by directly specifying the constants in the match filters or by referring to constants specified by the global `consts` section on top of the config.
type MatchFilters ¶
type MatchFilters struct {
From []string `yaml:"from,omitempty"`
To []string `yaml:"to,omitempty"`
Cc []string `yaml:"cc,omitempty"`
Subject []string `yaml:"subject,omitempty"`
Has []string `yaml:"has,omitempty"`
List []string `yaml:"list,omitempty"`
}
MatchFilters contains a list of filters interpreted at a higher level.
Every type of filter (e.g. Subject) is an array or requirements. They will be OR-ed together. If multiple types of filters are specified, they will be put in AND together.