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

datastore: Concurrency fix, closes #77

This commit is contained in:
James Hillyerd
2018-03-09 14:02:15 -08:00
parent a89b6bbca2
commit a3877e4f4b
6 changed files with 111 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"io"
"net/mail"
"sync"
"time"
"github.com/jhillyerd/enmime"
@@ -22,6 +23,8 @@ var (
type DataStore interface {
MailboxFor(emailAddress string) (Mailbox, error)
AllMailboxes() ([]Mailbox, error)
// LockFor is a temporary hack to fix #77 until Datastore revamp
LockFor(emailAddress string) (*sync.RWMutex, error)
}
// Mailbox is an interface to get and manipulate messages in a DataStore