diff controllers/json.go @ 239:713234a04a87

Renamed JSONHandler.Process to JSONHandler.Handler as it sounds more symmetrical.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 26 Jul 2018 17:15:22 +0200
parents 2b39bf2bf1fd
children 9012e4045da4
line wrap: on
line diff
--- a/controllers/json.go	Thu Jul 26 17:09:43 2018 +0200
+++ b/controllers/json.go	Thu Jul 26 17:15:22 2018 +0200
@@ -17,8 +17,8 @@
 }
 
 type JSONHandler struct {
-	Input   func() interface{}
-	Process func(http.ResponseWriter, *http.Request, interface{}, *sql.DB) (JSONResult, error)
+	Input  func() interface{}
+	Handle func(http.ResponseWriter, *http.Request, interface{}, *sql.DB) (JSONResult, error)
 }
 
 type JSONError struct {
@@ -45,7 +45,7 @@
 	token, _ := auth.GetToken(req)
 	var jr JSONResult
 	err := auth.ConnPool.Do(token, func(db *sql.DB) (err error) {
-		jr, err = j.Process(rw, req, input, db)
+		jr, err = j.Handle(rw, req, input, db)
 		return err
 	})