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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user