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