Documentation ¶
Index ¶
- func New(cfg config.Storage) (storage.Store, error)
- type Message
- func (m *Message) Date() time.Time
- func (m *Message) From() *mail.Address
- func (m *Message) ID() string
- func (m *Message) Mailbox() string
- func (m *Message) Seen() bool
- func (m *Message) Size() int64
- func (m *Message) Source() (reader io.ReadCloser, err error)
- func (m *Message) Subject() string
- func (m *Message) To() []*mail.Address
- type Store
- func (fs *Store) AddMessage(m storage.Message) (id string, err error)
- func (fs *Store) GetMessage(mailbox, id string) (storage.Message, error)
- func (fs *Store) GetMessages(mailbox string) ([]storage.Message, error)
- func (fs *Store) MarkSeen(mailbox, id string) error
- func (fs *Store) PurgeMessages(mailbox string) error
- func (fs *Store) RemoveMessage(mailbox, id string) error
- func (fs *Store) VisitMailboxes(f func([]storage.Message) (cont bool)) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message struct { // Stored in GOB Fid string Fdate time.Time Ffrom *mail.Address Fto []*mail.Address Fsubject string Fsize int64 Fseen bool // contains filtered or unexported fields }
Message implements Message and contains a little bit of data about a particular email message, and methods to retrieve the rest of it from disk.
func (*Message) Source ¶
func (m *Message) Source() (reader io.ReadCloser, err error)
Source opens the .raw portion of a Message as an io.ReadCloser
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements DataStore aand is the root of the mail storage hiearchy. It provides access to Mailbox objects
func (*Store) AddMessage ¶
AddMessage adds a message to the specified mailbox.
func (*Store) GetMessage ¶
GetMessage returns the messages in the named mailbox, or an error.
func (*Store) GetMessages ¶
GetMessages returns the messages in the named mailbox, or an error.
func (*Store) PurgeMessages ¶
PurgeMessages deletes all messages in the named mailbox, or returns an error.
func (*Store) RemoveMessage ¶
RemoveMessage deletes a message by ID from the specified mailbox.