dangogh closed pull request #1900: moved into systeminfo package for handler 
consistency
URL: https://github.com/apache/incubator-trafficcontrol/pull/1900
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/traffic_ops/traffic_ops_golang/routes.go 
b/traffic_ops/traffic_ops_golang/routes.go
index b59d92b3a6..ab5db98cd8 100644
--- a/traffic_ops/traffic_ops_golang/routes.go
+++ b/traffic_ops/traffic_ops_golang/routes.go
@@ -36,6 +36,7 @@ import (
        dsrequest 
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/deliveryservice/request"
        
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/division"
        
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/status"
+       
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/systeminfo"
        "github.com/basho/riak-go-client"
 )
 
@@ -135,7 +136,7 @@ func Routes(d ServerData) ([]Route, http.Handler, error) {
                {1.2, http.MethodPost, 
`deliveryservices-wip/hostname/{hostName}/sslkeys/add$`, 
addDeliveryServiceSSLKeysHandler(d.DB, d.Config), auth.PrivLevelAdmin, 
Authenticated, nil},
 
                //System
-               {1.2, http.MethodGet, `system/info/?(\.json)?$`, 
systemInfoHandler(d.DB), auth.PrivLevelReadOnly, Authenticated, nil},
+               {1.2, http.MethodGet, `system/info/?(\.json)?$`, 
systeminfo.Handler(d.DB), auth.PrivLevelReadOnly, Authenticated, nil},
 
                //Phys_Locations
                {1.2, http.MethodGet, `phys_locations/?(\.json)?$`, 
physLocationsHandler(d.DB), auth.PrivLevelReadOnly, Authenticated, nil},
diff --git a/traffic_ops/traffic_ops_golang/system_info.go 
b/traffic_ops/traffic_ops_golang/systeminfo/system_info.go
similarity index 97%
rename from traffic_ops/traffic_ops_golang/system_info.go
rename to traffic_ops/traffic_ops_golang/systeminfo/system_info.go
index 62e845b247..1554a56f98 100644
--- a/traffic_ops/traffic_ops_golang/system_info.go
+++ b/traffic_ops/traffic_ops_golang/systeminfo/system_info.go
@@ -1,4 +1,4 @@
-package main
+package systeminfo
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -30,7 +30,7 @@ import (
        "github.com/jmoiron/sqlx"
 )
 
-func systemInfoHandler(db *sqlx.DB) http.HandlerFunc {
+func Handler(db *sqlx.DB) http.HandlerFunc {
        return func(w http.ResponseWriter, r *http.Request) {
                handleErrs := tc.GetHandleErrorsFunc(w, r)
 
diff --git a/traffic_ops/traffic_ops_golang/system_info_test.go 
b/traffic_ops/traffic_ops_golang/systeminfo/system_info_test.go
similarity index 99%
rename from traffic_ops/traffic_ops_golang/system_info_test.go
rename to traffic_ops/traffic_ops_golang/systeminfo/system_info_test.go
index b0b449e884..902ea4048c 100644
--- a/traffic_ops/traffic_ops_golang/system_info_test.go
+++ b/traffic_ops/traffic_ops_golang/systeminfo/system_info_test.go
@@ -1,4 +1,4 @@
-package main
+package systeminfo
 
 /*
  * Licensed to the Apache Software Foundation (ASF) under one


 

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


With regards,
Apache Git Services

Reply via email to