1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

storage: Eliminate storage.Mailbox interface for #69

storage/file Mailbox has been renamed mbox, and is now just an
implementation detail.
This commit is contained in:
James Hillyerd
2018-03-11 11:54:35 -07:00
parent 137466f89b
commit 12ad0cb3f0
7 changed files with 45 additions and 143 deletions

View File

@@ -25,19 +25,12 @@ type Store interface {
GetMessages(mailbox string) ([]Message, error)
PurgeMessages(mailbox string) error
VisitMailboxes(f func([]Message) (cont bool)) error
MailboxFor(emailAddress string) (Mailbox, error)
// LockFor is a temporary hack to fix #77 until Datastore revamp
LockFor(emailAddress string) (*sync.RWMutex, error)
// NewMessage is temproary until #69 MessageData refactor
NewMessage(mailbox string) (Message, error)
}
// Mailbox is an interface to get and manipulate messages in a DataStore
type Mailbox interface {
GetMessages() ([]Message, error)
String() string
}
// Message is an interface for a single message in a Mailbox
type Message interface {
ID() string