You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by de...@apache.org on 2018/08/02 22:08:03 UTC

[trafficcontrol] 03/07: add func for which ds types use mids

This is an automated email from the ASF dual-hosted git repository.

dewrich pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 9eccfae404d57fdb8d4c69cc8efba56a2635c963
Author: Dan Kirkwood <da...@apache.org>
AuthorDate: Wed Jul 25 15:09:40 2018 -0600

    add func for which ds types use mids
---
 lib/go-tc/enum.go | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/go-tc/enum.go b/lib/go-tc/enum.go
index 7d203d5..b0cb3bd 100644
--- a/lib/go-tc/enum.go
+++ b/lib/go-tc/enum.go
@@ -392,6 +392,19 @@ func (t DSType) IsNational() bool {
 	return false
 }
 
+// UsesMidCache returns whether delivery services of this type use mid-tier caches
+func (t DSType) UsesMidCache() bool {
+	switch t {
+	case DSTypeDNSLive:
+		fallthrough
+	case DSTypeHTTPLive:
+		fallthrough
+	case DSTypeHTTPNoCache:
+		return true
+	}
+	return false
+}
+
 type DSMatchType string
 
 const (