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

storage: More refactoring for #69

- impl Store.AddMessage
- file: Use AddMessage() in tests
- smtp: Switch to AddMessage
- storage: Remove NewMessage, Append, Close methods
This commit is contained in:
James Hillyerd
2018-03-13 22:00:44 -07:00
parent 9be4eec31c
commit 2cc0da3093
10 changed files with 208 additions and 208 deletions

View File

@@ -19,6 +19,8 @@ var (
// Store is the interface Inbucket uses to interact with storage implementations.
type Store interface {
// AddMessage stores the message, message ID and Size will be ignored.
AddMessage(message StoreMessage) (id string, err error)
GetMessage(mailbox, id string) (StoreMessage, error)
GetMessages(mailbox string) ([]StoreMessage, error)
PurgeMessages(mailbox string) error
@@ -39,8 +41,5 @@ type StoreMessage interface {
Date() time.Time
Subject() string
RawReader() (reader io.ReadCloser, err error)
Append(data []byte) error
Close() error
String() string
Size() int64
}