1
0
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:
James Hillyerd
2018-03-10 18:50:18 -08:00
parent a58dfc5e4f
commit 9c18f1fb30
12 changed files with 160 additions and 227 deletions

View File

@@ -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
}