Skip to content

Commit

Permalink
Breaking Changes - Package can only be used as a library
Browse files Browse the repository at this point in the history
Signed-off-by: jay-dee7 <[email protected]>
  • Loading branch information
jay-dee7 committed Jan 17, 2021
1 parent 6c6b9dd commit 2172611
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,13 @@ var cfg = DefaultConfig()
func Configure(multiTenant bool) *Config {

if multiTenant {
s := storage.CreateMultiTenantMongoDB(cfg.MongoURI, cfg.MongoDb)
s := storage.CreateMultiTenantMongoDB(cfg.MongoURI, cfg.MongoDb, "")
cfg.Storage = s
} else {
s := storage.CreateMongoDB(cfg.MongoURI, cfg.MongoDb, cfg.MongoColl)
cfg.SimpleStorage = s
}



if len(cfg.OutgoingSMTPFile) > 0 {
b, err := ioutil.ReadFile(cfg.OutgoingSMTPFile)
if err != nil {
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,20 @@ require (
github.com/ian-kent/goose v0.0.0-20141221090059-c3541ea826ad
github.com/ian-kent/linkio v0.0.0-20170807205755-97566b872887
github.com/jay-dee7/smtp v1.0.2-0.20201210121320-9710b09861d5
github.com/jay-dee7/storage v1.0.2-0.20210117130833-7fbf82b76db8
github.com/jay-dee7/storage v1.0.2
github.com/kr/pretty v0.2.1 // indirect
github.com/labstack/echo/v4 v4.1.17
github.com/mailhog/MailHog v1.0.1
github.com/mailhog/MailHog-Server v1.0.1
github.com/mailhog/data v1.0.1
github.com/mailhog/http v1.0.1
github.com/mailhog/storage v1.0.1
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/philhofer/fwd v1.0.0 // indirect
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/testify v1.6.1 // indirect
github.com/t-k/fluent-logger-golang v1.0.0 // indirect
github.com/tinylib/msgp v1.1.2 // indirect
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee // indirect
golang.org/x/net v0.0.0-20200822124328-c89045814202
gopkg.in/check.v1 v1.0.0-20200902074654-038fdea0a05b // indirect
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
Expand Down
10 changes: 6 additions & 4 deletions smtp/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
. "github.com/smartystreets/goconvey/convey"

"github.com/mailhog/data"
"github.com/mailhog/storage"
)

type fakeRw struct {
Expand Down Expand Up @@ -40,7 +39,8 @@ func TestAccept(t *testing.T) {
Convey("Accept should handle a connection", t, func() {
frw := &fakeRw{}
mChan := make(chan *data.Message)
Accept("1.1.1.1:11111", frw, storage.CreateInMemory(), mChan, "localhost", nil)
/// @TODO create in-memorry multi tenant storage and use it here
Accept("1.1.1.1:11111", frw, nil, mChan, "localhost", nil, "test")
})
}

Expand All @@ -52,7 +52,8 @@ func TestSocketError(t *testing.T) {
},
}
mChan := make(chan *data.Message)
Accept("1.1.1.1:11111", frw, storage.CreateInMemory(), mChan, "localhost", nil)
/// @TODO create in-memorry multi tenant storage and use it here
Accept("1.1.1.1:11111", frw, nil, mChan, "localhost", nil, "test")
})
}

Expand Down Expand Up @@ -98,7 +99,8 @@ func TestAcceptMessage(t *testing.T) {
//So(m, ShouldNotBeNil)
wg.Done()
}()
Accept("1.1.1.1:11111", frw, storage.CreateInMemory(), mChan, "localhost", nil)
/// @TODO create in-memorry multi tenant storage and use it here
Accept("1.1.1.1:11111", frw, nil, mChan, "localhost", nil, "test")
wg.Wait()
So(handlerCalled, ShouldBeTrue)
})
Expand Down

0 comments on commit 2172611

Please sign in to comment.