Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Store)
Option is a Store option.
func Collection ¶
Collection returns an Option that specifies the used collection.
func CreateIndexes ¶
CreateIndexes returns an Option that creates the indexes for the mails collection.
func RFCOptions ¶ added in v0.11.0
RFCOptions returns an Option that adds rfc.Options when building the rfc body of a mail.
func WithoutAttachmentContent ¶ added in v0.10.0
WithoutAttachmentContent returns an Option that empties the attachment contents of mails before they are stored in the database.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the mongo store.
func NewStore ¶
NewStore returns a mongo store. It returns an error if either client is nil or CreateIndexes() is used and index creation fails.
func (*Store) Find ¶
Find fetches the mail with the given id from the database. If it can't find the mail, it returns archive.ErrNotFound.
func (*Store) Insert ¶
Insert stores m into the database. If there's already a stored mail with the same ID as m, m will override the previously stored mail.