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

storage: Make locking an implementation detail for #69

- file: Store handles its own locking #77
- file: Move mbox into its own file
- file & test: remove LockFor()
This commit is contained in:
James Hillyerd
2018-03-17 14:02:50 -07:00
parent b9003a9328
commit e84b1f8952
5 changed files with 288 additions and 292 deletions

View File

@@ -5,7 +5,6 @@ import (
"errors"
"io"
"net/mail"
"sync"
"time"
)
@@ -26,8 +25,6 @@ type Store interface {
PurgeMessages(mailbox string) error
RemoveMessage(mailbox, id string) error
VisitMailboxes(f func([]StoreMessage) (cont bool)) error
// LockFor is a temporary hack to fix #77 until Datastore revamp
LockFor(emailAddress string) (*sync.RWMutex, error)
}
// StoreMessage represents a message to be stored, or returned from a storage implementation.