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:
@@ -1,4 +1,4 @@
|
|||||||
package smtpd
|
package filestore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package smtpd
|
package filestore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
"bufio"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package smtpd
|
package filestore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
@@ -470,8 +470,8 @@ func TestGetLatestMessage(t *testing.T) {
|
|||||||
mb, err := ds.MailboxFor(mbName)
|
mb, err := ds.MailboxFor(mbName)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
msg, err := mb.GetMessage("latest")
|
msg, err := mb.GetMessage("latest")
|
||||||
|
assert.Nil(t, msg)
|
||||||
assert.Error(t, err)
|
assert.Error(t, err)
|
||||||
fmt.Println(msg)
|
|
||||||
|
|
||||||
// Deliver test message
|
// Deliver test message
|
||||||
deliverMessage(ds, mbName, "test", time.Now())
|
deliverMessage(ds, mbName, "test", time.Now())
|
||||||
@@ -13,6 +13,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/jhillyerd/inbucket/config"
|
"github.com/jhillyerd/inbucket/config"
|
||||||
|
"github.com/jhillyerd/inbucket/filestore"
|
||||||
"github.com/jhillyerd/inbucket/httpd"
|
"github.com/jhillyerd/inbucket/httpd"
|
||||||
"github.com/jhillyerd/inbucket/log"
|
"github.com/jhillyerd/inbucket/log"
|
||||||
"github.com/jhillyerd/inbucket/msghub"
|
"github.com/jhillyerd/inbucket/msghub"
|
||||||
@@ -115,7 +116,7 @@ func main() {
|
|||||||
msgHub := msghub.New(rootCtx, config.GetWebConfig().MonitorHistory)
|
msgHub := msghub.New(rootCtx, config.GetWebConfig().MonitorHistory)
|
||||||
|
|
||||||
// Grab our datastore
|
// Grab our datastore
|
||||||
ds := smtpd.DefaultFileDataStore()
|
ds := filestore.DefaultFileDataStore()
|
||||||
|
|
||||||
// Start HTTP server
|
// Start HTTP server
|
||||||
httpd.Initialize(config.GetWebConfig(), shutdownChan, ds, msgHub)
|
httpd.Initialize(config.GetWebConfig(), shutdownChan, ds, msgHub)
|
||||||
|
|||||||
Reference in New Issue
Block a user