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

Refactor filestore into a dedicated pkg, closes #67

This commit is contained in:
James Hillyerd
2017-12-26 23:04:39 -08:00
parent 25815767a7
commit 6431b71cfe
4 changed files with 6 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
package smtpd
package filestore
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package smtpd
package filestore
import (
"bufio"

View File

@@ -1,4 +1,4 @@
package smtpd
package filestore
import (
"bytes"
@@ -470,8 +470,8 @@ func TestGetLatestMessage(t *testing.T) {
mb, err := ds.MailboxFor(mbName)
assert.Nil(t, err)
msg, err := mb.GetMessage("latest")
assert.Nil(t, msg)
assert.Error(t, err)
fmt.Println(msg)
// Deliver test message
deliverMessage(ds, mbName, "test", time.Now())

View File

@@ -13,6 +13,7 @@ import (
"time"
"github.com/jhillyerd/inbucket/config"
"github.com/jhillyerd/inbucket/filestore"
"github.com/jhillyerd/inbucket/httpd"
"github.com/jhillyerd/inbucket/log"
"github.com/jhillyerd/inbucket/msghub"
@@ -115,7 +116,7 @@ func main() {
msgHub := msghub.New(rootCtx, config.GetWebConfig().MonitorHistory)
// Grab our datastore
ds := smtpd.DefaultFileDataStore()
ds := filestore.DefaultFileDataStore()
// Start HTTP server
httpd.Initialize(config.GetWebConfig(), shutdownChan, ds, msgHub)