1
0
mirror of https://github.com/jhillyerd/inbucket.git synced 2025-12-20 02:57:05 +00:00

Implement server side of message monitor for #44

This commit is contained in:
James Hillyerd
2017-01-16 18:12:27 -08:00
parent e32e6d00d6
commit e5aad9f5d0
6 changed files with 184 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/gorilla/mux"
"github.com/gorilla/sessions"
"github.com/jhillyerd/inbucket/msghub"
"github.com/jhillyerd/inbucket/smtpd"
)
@@ -14,6 +15,7 @@ type Context struct {
Vars map[string]string
Session *sessions.Session
DataStore smtpd.DataStore
MsgHub *msghub.Hub
IsJSON bool
}
@@ -56,6 +58,7 @@ func NewContext(req *http.Request) (*Context, error) {
Vars: vars,
Session: sess,
DataStore: DataStore,
MsgHub: msgHub,
IsJSON: headerMatch(req, "Accept", "application/json"),
}
return ctx, err