You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2020/03/02 19:53:08 UTC

[GitHub] [trafficcontrol] mattjackson220 commented on a change in pull request #4452: deprecate /servers/checks and move functionality to /servercheck

mattjackson220 commented on a change in pull request #4452: deprecate /servers/checks and move functionality to /servercheck
URL: https://github.com/apache/trafficcontrol/pull/4452#discussion_r386614514
 
 

 ##########
 File path: traffic_ops/traffic_ops_golang/servercheck/servercheck.go
 ##########
 @@ -205,57 +208,79 @@ func ReadServersChecks(w http.ResponseWriter, r *http.Request) {
 	}
 	defer inf.Close()
 
+	data, userErr, sysErr, errCode := handleReadServerCheck(inf, tx)
+	if userErr != nil || sysErr != nil {
+		api.HandleErr(w, r, tx, errCode, userErr, sysErr)
+	}
+
+	api.WriteResp(w, r, data)
+}
+
+// DeprecatedReadServersChecks is the handler for deprecated GET requests for /servers/checks
+func DeprecatedReadServersChecks(w http.ResponseWriter, r *http.Request) {
+	inf, userErr, sysErr, errCode := api.NewInfo(r, nil, nil)
+	tx := inf.Tx.Tx
+	if userErr != nil || sysErr != nil {
+		api.HandleDeprecatedErr(w, r, tx, errCode, userErr, sysErr, util.StrPtr(ServerCheck_Get_Endpoint))
 
 Review comment:
   Go doesnt let you do & to a const.  so i went this route to keep it a const, but im also open to changing it to a var and then doing &.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services