diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-01-08 00:51:37 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-01-08 00:51:37 (GMT) |
commit | 63db9233d681006b1b1fb4999825d21e79dfcec5 (patch) | |
tree | 0683ed60874493597cfd6e0b87fd2cb33c6f6ea1 /src/rhimportd/ctrlWebSimple.go | |
parent | 92f96b74e3816214a65973b3b362424d110b3a77 (diff) |
move rddb to rhrd-go
Diffstat (limited to 'src/rhimportd/ctrlWebSimple.go')
-rw-r--r-- | src/rhimportd/ctrlWebSimple.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/rhimportd/ctrlWebSimple.go b/src/rhimportd/ctrlWebSimple.go index cd2c556..15f06ee 100644 --- a/src/rhimportd/ctrlWebSimple.go +++ b/src/rhimportd/ctrlWebSimple.go @@ -28,6 +28,7 @@ import ( "encoding/json" "fmt" "helsinki.at/rhimport" + "helsinki.at/rhrd-go/rddb" "html" "net/http" ) @@ -90,7 +91,7 @@ func webSimpleResponse(w http.ResponseWriter, result *rhimport.Result) { encoder.Encode(respdata) } -func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) { +func webSimpleParseRequest(conf *rhimport.Config, db *rddb.DBChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) { decoder := json.NewDecoder(r.Body) reqdata := newWebSimpleRequestData(conf) @@ -99,7 +100,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust return } - ctx = rhimport.NewContext(conf, rddb) + ctx = rhimport.NewContext(conf, db) if trusted { ctx.UserName = r.Header.Get("X-Forwarded-User") } else { @@ -121,12 +122,12 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust return } -func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) { +func webSimpleHandler(conf *rhimport.Config, db *rddb.DBChan, sessions *rhimport.SessionStoreChan, trusted bool, w http.ResponseWriter, r *http.Request) { rhdl.Printf("WebSimpleHandler: request for '%s'", html.EscapeString(r.URL.Path)) var ctx *rhimport.Context var err error - if ctx, err = webSimpleParseRequest(conf, rddb, trusted, r); err != nil { + if ctx, err = webSimpleParseRequest(conf, db, trusted, r); err != nil { webSimpleErrorResponse(w, http.StatusBadRequest, err.Error()) return } |