You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by da...@apache.org on 2018/02/23 17:26:40 UTC
[incubator-trafficcontrol] 01/02: moved into systeminfo package
This is an automated email from the ASF dual-hosted git repository.
dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git
commit 44b1a78af1ef9086e63a48cac6315e1f5d37da0c
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Wed Feb 21 09:04:45 2018 -0700
moved into systeminfo package
---
traffic_ops/traffic_ops_golang/routes.go | 7 ++++++-
traffic_ops/traffic_ops_golang/{ => systeminfo}/system_info.go | 4 ++--
.../traffic_ops_golang/{ => systeminfo}/system_info_test.go | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/traffic_ops/traffic_ops_golang/routes.go b/traffic_ops/traffic_ops_golang/routes.go
index a61c015..4389dbf 100644
--- a/traffic_ops/traffic_ops_golang/routes.go
+++ b/traffic_ops/traffic_ops_golang/routes.go
@@ -37,6 +37,7 @@ import (
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/division"
"github.com/apache/incubator-trafficcontrol/traffic_ops/traffic_ops_golang/region"
"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"
)
@@ -138,8 +139,12 @@ func Routes(d ServerData) ([]Route, http.Handler, error) {
{1.2, http.MethodGet, `deliveryservices-wip/hostname/{hostName}/sslkeys$`, getDeliveryServiceSSLKeysByHostNameHandler(d.DB, d.Config), auth.PrivLevelAdmin, Authenticated, nil},
{1.2, http.MethodPost, `deliveryservices-wip/hostname/{hostName}/sslkeys/add$`, addDeliveryServiceSSLKeysHandler(d.DB, d.Config), auth.PrivLevelAdmin, Authenticated, nil},
+ //Statuses
+ {1.2, http.MethodGet, `statuses/?(\.json)?$`, statusesHandler(d.DB), auth.PrivLevelReadOnly, Authenticated, nil},
+ {1.2, http.MethodGet, `statuses/{id}$`, statusesHandler(d.DB), auth.PrivLevelReadOnly, 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 62e845b..1554a56 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 b0b449e..902ea40 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
--
To stop receiving notification emails like this one, please contact
dangogh@apache.org.