mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
Large refactor for #69
- makefile: Don't refresh deps automatically, causes double build - storage: Move GetMessage, GetMessages (Mailbox), PurgeMessages to the Store API for #69 - storage: Remove Mailbox.Name method for #69 - test: Create new test package for #79 - test: Implement StoreStub, migrate some tests off MockDataStore for task #80 - rest & webui: update controllers to use new Store methods
This commit is contained in:
@@ -21,6 +21,9 @@ var (
|
||||
|
||||
// Store is an interface to get Mailboxes stored in Inbucket
|
||||
type Store interface {
|
||||
GetMessage(mailbox string, id string) (Message, error)
|
||||
GetMessages(mailbox string) ([]Message, error)
|
||||
PurgeMessages(mailbox string) error
|
||||
MailboxFor(emailAddress string) (Mailbox, error)
|
||||
AllMailboxes() ([]Mailbox, error)
|
||||
// LockFor is a temporary hack to fix #77 until Datastore revamp
|
||||
@@ -30,10 +33,7 @@ type Store interface {
|
||||
// Mailbox is an interface to get and manipulate messages in a DataStore
|
||||
type Mailbox interface {
|
||||
GetMessages() ([]Message, error)
|
||||
GetMessage(id string) (Message, error)
|
||||
Purge() error
|
||||
NewMessage() (Message, error)
|
||||
Name() string
|
||||
String() string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user