summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/ctrlWeb.go
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2015-12-29 12:16:20 (GMT)
committerChristian Pointner <equinox@helsinki.at>2015-12-29 12:16:20 (GMT)
commit485e0b2bdcec3c82d6c0b4d7719808a0dfc9289c (patch)
treef3cf076abd2745f91e39c0c30228a77bbeda3bb4 /src/helsinki.at/rhimportd/ctrlWeb.go
parentb84ca16ba73b56229b3c99dc2a9dd61508519c5e (diff)
export session store to control interfaces
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWeb.go')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWeb.go15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWeb.go b/src/helsinki.at/rhimportd/ctrlWeb.go
index 894780c..2a95676 100644
--- a/src/helsinki.at/rhimportd/ctrlWeb.go
+++ b/src/helsinki.at/rhimportd/ctrlWeb.go
@@ -34,20 +34,21 @@ import (
type webHandler struct {
*rhimport.Config
*rhimport.RdDbChan
+ *rhimport.SessionStoreChan
trusted bool
- H func(*rhimport.Config, *rhimport.RdDbChan, bool, http.ResponseWriter, *http.Request)
+ H func(*rhimport.Config, *rhimport.RdDbChan, *rhimport.SessionStoreChan, bool, http.ResponseWriter, *http.Request)
}
func (self webHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
- self.H(self.Config, self.RdDbChan, self.trusted, w, r)
+ self.H(self.Config, self.RdDbChan, self.SessionStoreChan, self.trusted, w, r)
}
-func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDbChan) {
- http.Handle("/public/simple", webHandler{conf, rddb, false, webSimpleHandler})
- http.Handle("/trusted/simple", webHandler{conf, rddb, true, webSimpleHandler})
+func StartControlWeb(addr_s string, conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan) {
+ http.Handle("/public/simple", webHandler{conf, rddb, sessions, false, webSimpleHandler})
+ http.Handle("/trusted/simple", webHandler{conf, rddb, sessions, true, webSimpleHandler})
- http.Handle("/public/socket", webHandler{conf, rddb, false, webSocketHandler})
- http.Handle("/trusted/socket", webHandler{conf, rddb, true, webSocketHandler})
+ http.Handle("/public/socket", webHandler{conf, rddb, sessions, false, webSocketHandler})
+ http.Handle("/trusted/socket", webHandler{conf, rddb, sessions, true, webSocketHandler})
rhl.Println("web-ctrl: listening on", addr_s)
server := &http.Server{Addr: addr_s, ReadTimeout: 60 * time.Second, WriteTimeout: 60 * time.Second}