sv_filter

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	AddLabelIds    []string `json:"addLabelIds,omitempty"`
	RemoveLabelIds []string `json:"removeLabelIds,omitempty"`
	Forward        string   `json:"forward,omitempty"`
}

type Criteria

type Criteria struct {
	From           string `json:"from,omitempty"`
	To             string `json:"to,omitempty"`
	Subject        string `json:"subject,omitempty"`
	Query          string `json:"query,omitempty"`
	NegatedQuery   string `json:"negatedQuery,omitempty"`
	HasAttachment  *bool  `json:"hasAttachment,omitempty"`
	ExcludeChats   *bool  `json:"excludeChats,omitempty"`
	Size           *int   `json:"size,omitempty"`
	SizeComparison string `json:"sizeComparison,omitempty"`
}

type Filter

type Filter interface {
	List() (filters []*mo_filter.Filter, err error)
	Resolve(id string) (filter *mo_filter.Filter, err error)
	Delete(id string) error
	Add(opts ...Opt) (filter *mo_filter.Filter, err error)
}

func New

func New(ctx goog_context.Context, userId string) Filter

type Opt

type Opt func(o Opts) Opts

func AddLabelIds

func AddLabelIds(v []string) Opt

func ExcludeChats

func ExcludeChats(v bool) Opt

func Forward

func Forward(v string) Opt

func From

func From(v string) Opt

func HasAttachment

func HasAttachment(v bool) Opt

func NegatedQuery

func NegatedQuery(v string) Opt

func Query

func Query(v string) Opt

func RemoveLabelIds

func RemoveLabelIds(v []string) Opt

func Size

func Size(v int) Opt

func SizeComparison

func SizeComparison(v string) Opt

func Subject

func Subject(v string) Opt

func To

func To(v string) Opt

type Opts

type Opts struct {
	Criteria Criteria `json:"criteria,omitempty"`
	Action   Action   `json:"action,omitempty"`
}

func (Opts) Apply

func (z Opts) Apply(opts ...Opt) Opts

Jump to

Keyboard shortcuts

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