summaryrefslogtreecommitdiff
path: root/src/helsinki.at/rhimportd/ctrlWebSimple.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/helsinki.at/rhimportd/ctrlWebSimple.go')
-rw-r--r--src/helsinki.at/rhimportd/ctrlWebSimple.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/helsinki.at/rhimportd/ctrlWebSimple.go b/src/helsinki.at/rhimportd/ctrlWebSimple.go
index 8af421f..9a408ed 100644
--- a/src/helsinki.at/rhimportd/ctrlWebSimple.go
+++ b/src/helsinki.at/rhimportd/ctrlWebSimple.go
@@ -82,7 +82,7 @@ func webSimpleErrorResponse(w http.ResponseWriter, code int, errStr string) {
encoder.Encode(respdata)
}
-func webSimpleResponse(w http.ResponseWriter, result *rhimport.ImportResult) {
+func webSimpleResponse(w http.ResponseWriter, result *rhimport.Result) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusInternalServerError)
encoder := json.NewEncoder(w)
@@ -90,7 +90,7 @@ func webSimpleResponse(w http.ResponseWriter, result *rhimport.ImportResult) {
encoder.Encode(respdata)
}
-func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trusted bool, r *http.Request) (ctx *rhimport.ImportContext, err error) {
+func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trusted bool, r *http.Request) (ctx *rhimport.Context, err error) {
decoder := json.NewDecoder(r.Body)
reqdata := newWebSimpleRequestData(conf)
@@ -103,7 +103,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust
if trusted {
username = r.Header.Get("X-Forwarded-User")
}
- ctx = rhimport.NewImportContext(conf, rddb, username)
+ ctx = rhimport.NewContext(conf, rddb, username)
ctx.Password = reqdata.Password
ctx.Trusted = trusted
ctx.ShowId = reqdata.ShowId
@@ -123,7 +123,7 @@ func webSimpleParseRequest(conf *rhimport.Config, rddb *rhimport.RdDbChan, trust
func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RdDbChan, 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.ImportContext
+ var ctx *rhimport.Context
var err error
if ctx, err = webSimpleParseRequest(conf, rddb, trusted, r); err != nil {
webSimpleErrorResponse(w, http.StatusBadRequest, err.Error())
@@ -135,7 +135,7 @@ func webSimpleHandler(conf *rhimport.Config, rddb *rhimport.RdDbChan, sessions *
return
}
- var res *rhimport.ImportResult
+ var res *rhimport.Result
if res, err = rhimport.FetchFile(ctx); err != nil {
webSimpleErrorResponse(w, http.StatusInternalServerError, err.Error())
return