You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by el...@apache.org on 2017/01/09 21:13:07 UTC

[3/4] incubator-trafficcontrol git commit: Fix TM2 for EDGE*, MID* types

Fix TM2 for EDGE*, MID* types


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/ae293c87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/ae293c87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/ae293c87

Branch: refs/heads/master
Commit: ae293c8703b67dd6e8926743b1fd180f8e6a71f3
Parents: 02e399f
Author: Robert Butts <ro...@gmail.com>
Authored: Mon Jan 9 11:25:09 2017 -0700
Committer: Jeff Elsloo <je...@cable.comcast.com>
Committed: Mon Jan 9 14:11:58 2017 -0700

----------------------------------------------------------------------
 .../experimental/traffic_monitor/enum/enum.go         | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/ae293c87/traffic_monitor/experimental/traffic_monitor/enum/enum.go
----------------------------------------------------------------------
diff --git a/traffic_monitor/experimental/traffic_monitor/enum/enum.go b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
index 77f8ea4..733bba5 100644
--- a/traffic_monitor/experimental/traffic_monitor/enum/enum.go
+++ b/traffic_monitor/experimental/traffic_monitor/enum/enum.go
@@ -10,9 +10,9 @@ package enum
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -21,7 +21,6 @@ package enum
  * under the License.
  */
 
-
 import (
 	"strings"
 )
@@ -65,14 +64,13 @@ func (t CacheType) String() string {
 // CacheTypeFromString returns a cache type object from its string representation, or CacheTypeInvalid if the string is not a valid type.
 func CacheTypeFromString(s string) CacheType {
 	s = strings.ToLower(s)
-	switch s {
-	case "edge":
+	if strings.HasPrefix(s, "edge") {
 		return CacheTypeEdge
-	case "mid":
+	}
+	if strings.HasPrefix(s, "mid") {
 		return CacheTypeMid
-	default:
-		return CacheTypeInvalid
 	}
+	return CacheTypeInvalid
 }
 
 // DSType is the Delivery Service type. HTTP, DNS, etc.