Documentation ¶
Index ¶
- func AddField(field func() *Field)
- func BuildCriteria(clauses ...*WhereClause) *imap.SearchCriteria
- func GetFieldsFromMessage(m *email.Message, fields []*Field) map[string]interface{}
- func Query(c *imapclient.Client, query string, messageCh chan<- *email.Message) error
- func Select(c *imapclient.Client, fields []*Field, from string, limit int64, ...) error
- func TriageMessage(m *email.Message, conds ...*WhereClause) bool
- type Clause
- type Field
- type Operator
- type ParseResult
- type Table
- type WhereClause
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCriteria ¶
func BuildCriteria(clauses ...*WhereClause) *imap.SearchCriteria
func GetFieldsFromMessage ¶
func Select ¶
func Select(c *imapclient.Client, fields []*Field, from string, limit int64, messageCh chan<- *email.Message, clauses ...*WhereClause) error
func TriageMessage ¶
func TriageMessage(m *email.Message, conds ...*WhereClause) bool
Types ¶
type Field ¶
type Field struct { Name string Aliases []string AllowedOperators []Operator Selectable bool Searchable bool Valid bool Reason string GetValue func(m *email.Message) interface{} ApplyFetchOptions func(options *imap.FetchOptions) ApplyCriteria func(criteria *imap.SearchCriteria, clause *WhereClause) Triage func(m *email.Message, clause *WhereClause) bool }
func GetFieldsFromQuery ¶
func ListFields ¶
func ListFields() []*Field
func (*Field) IsAllowedOperator ¶
func (*Field) SetInvalid ¶
func (*Field) SetInvalidOperator ¶
type ParseResult ¶
type ParseResult struct { Clause string Fields []*Field From string Mailbox string Conds []*WhereClause Limit int64 }
func ParseQuery ¶
func ParseQuery(sql string) (result *ParseResult, err error)
type WhereClause ¶
func (*WhereClause) ApplyCriteria ¶
func (w *WhereClause) ApplyCriteria(criteria *imap.SearchCriteria)
func (*WhereClause) GetKey ¶
func (w *WhereClause) GetKey() string
func (*WhereClause) GetValue ¶
func (w *WhereClause) GetValue() string
GetValue returns the first value of the clause.
func (*WhereClause) String ¶
func (w *WhereClause) String() string
String returns the string representation of the clause.
Click to show internal directories.
Click to hide internal directories.