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.
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.
Click to show internal directories.
Click to hide internal directories.