1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-17 09:37:02 +00:00

storage: Move NewMessage() into Store interface for #69

This commit is contained in:
James Hillyerd
2018-03-11 10:48:50 -07:00
parent d9b5e40c87
commit 137466f89b
7 changed files with 26 additions and 9 deletions

View File

@@ -175,6 +175,15 @@ func (fs *Store) LockFor(emailAddress string) (*sync.RWMutex, error) {
return fs.hashLock.Get(hash), nil
}
// NewMessage is temproary until #69 MessageData refactor
func (fs *Store) NewMessage(mailbox string) (storage.Message, error) {
mb, err := fs.MailboxFor(mailbox)
if err != nil {
return nil, err
}
return mb.(*Mailbox).NewMessage()
}
// Mailbox implements Mailbox, manages the mail for a specific user and
// correlates to a particular directory on disk.
type Mailbox struct {