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

web: remove DataStore from Context and controllers for #81

This commit is contained in:
James Hillyerd
2018-03-12 20:49:06 -07:00
parent 10bc07a18e
commit 219862797e
7 changed files with 21 additions and 32 deletions

View File

@@ -9,16 +9,14 @@ import (
"github.com/jhillyerd/inbucket/pkg/config"
"github.com/jhillyerd/inbucket/pkg/message"
"github.com/jhillyerd/inbucket/pkg/msghub"
"github.com/jhillyerd/inbucket/pkg/storage"
)
// Context is passed into every request handler function
type Context struct {
Vars map[string]string
Session *sessions.Session
DataStore storage.Store
MsgHub *msghub.Hub
MsgSvc message.Manager
Manager message.Manager
WebConfig config.WebConfig
IsJSON bool
}
@@ -61,9 +59,8 @@ func NewContext(req *http.Request) (*Context, error) {
ctx := &Context{
Vars: vars,
Session: sess,
DataStore: DataStore,
MsgHub: msgHub,
MsgSvc: msgSvc,
Manager: manager,
WebConfig: webConfig,
IsJSON: headerMatch(req, "Accept", "application/json"),
}