Documentation ¶
Index ¶
- Constants
- type AttachmentFilter
- type AttachmentSizeFilter
- type Option
- func AttachmentContent(content ...[]byte) Option
- func AttachmentContentType(cts ...string) Option
- func AttachmentFilename(names ...string) Option
- func AttachmentSize(sizes ...int) Option
- func AttachmentSizeRange(min, max int) Option
- func BCC(addr ...mail.Address) Option
- func CC(addr ...mail.Address) Option
- func From(addr ...mail.Address) Option
- func HTML(html ...string) Option
- func Paginate(page, perPage int) Option
- func RFC(rfc ...string) Option
- func Recipient(rcpts ...mail.Address) Option
- func SendError(errs ...string) Option
- func SentAfter(t ...time.Time) Option
- func SentAt(t ...time.Time) Option
- func SentBefore(t ...time.Time) Option
- func SentBetween(l, r time.Time) Option
- func Sort(by Sorting, dir SortDirection) Option
- func Subject(subjects ...string) Option
- func Text(texts ...string) Option
- func To(addr ...mail.Address) Option
- type Pagination
- type Query
- type SendTimeFilter
- type SortDirection
- type Sorting
Constants ¶
const ( // SortAny is the default Sorting and sorts with an undefined / unpredictable behavior. SortAny = Sorting(iota) // SortSendTime sorts mails by their send time. SortSendTime // SortSubject sorts mails by their subject. SortSubject )
const ( // SortAsc sorts in ascending order. SortAsc = SortDirection(iota) // SortDesc sorts in descending order. SortDesc )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttachmentFilter ¶
type AttachmentFilter struct { Filenames []string ContentTypes []string Contents [][]byte Size AttachmentSizeFilter }
AttachmentFilter is the query filter for attachments.
type AttachmentSizeFilter ¶
AttachmentSizeFilter is the query filter for attachment file sizes.
type Option ¶
type Option func(*Query)
Option is a Query option.
func AttachmentContent ¶
AttachmentContent returns an Option that adds an attachment filter to a Query. It filters attachments by their actual file contents.
func AttachmentContentType ¶
AttachmentContentType returns an Option that adds an attachment filter to a Query. It filters attachments by their MIME `Content-Type`.
func AttachmentFilename ¶
AttachmentFilename returns an Option that adds an attachment filter to a Query. It filters attachments by their filename.
func AttachmentSize ¶
AttachmentSize returns an Option that add an attachment filter to a Query. It filters attachments by their file size.
func AttachmentSizeRange ¶
AttachmentSizeRange returns an Option that adds an attachment filter to a Query. It filters attachments by their file size, where the attachment's file size must be in the inclusive range (min, max).
func SentAfter ¶
SentAfter returns an Option that filters mails by their send time. The send time of a mail must be after any of t.
func SentAt ¶
SentAt returns an Option that filters mails by their send time. The send time of a mail must be one of t.
func SentBefore ¶
SentBefore returns an Option that filters mails by their send time. The send time of a mail must be before any of t.
func SentBetween ¶
SentBetween returns an Option that filters mails by their send time. The send time of a mail must be between (l, r).
func Sort ¶
func Sort(by Sorting, dir SortDirection) Option
Sort returns an Option that configures the Sorting of a Query.
type Pagination ¶
Pagination is a pagination option.
type Query ¶
type Query struct { From []mail.Address To []mail.Address CC []mail.Address BCC []mail.Address Recipients []mail.Address Subjects []string Texts []string HTML []string RFC []string SendErrors []string SendTime SendTimeFilter Attachment AttachmentFilter Sorting Sorting SortDirection SortDirection Pagination Pagination }
Query provides filters, sorting & pagination for querying mails.
type SendTimeFilter ¶
SendTimeFilter is the query filter for the send date.