Remove debug queries (#1058)

* Remove debug from interface and methods

* remove debug queries from etcd

* remove debug queries from k8s - they were not used

* And remove from mw/proxy-google as well

* Remove debug query test
This commit is contained in:
Miek Gieben
2017-09-12 10:52:43 +01:00
committed by GitHub
parent c2105a4f41
commit 3e252deabb
17 changed files with 99 additions and 462 deletions

View File

@@ -1,21 +0,0 @@
package debug
import "strings"
// Name is the domain prefix we check for when it is a debug query.
const Name = "o-o.debug."
// IsDebug checks if name is a debugging name, i.e. starts with o-o.debug.
// it returns the empty string if it is not a debug message, otherwise it will return the
// name with o-o.debug. stripped off. Name will be lowercased before comparing.
func IsDebug(name string) string {
if len(name) == len(Name) {
return ""
}
name = strings.ToLower(name)
debug := strings.HasPrefix(name, Name)
if !debug {
return ""
}
return name[len(Name):]
}

View File

@@ -1,21 +0,0 @@
package debug
import (
"strings"
"testing"
)
func TestIsDebug(t *testing.T) {
if ok := IsDebug("o-o.debug.miek.nl."); ok != "miek.nl." {
t.Errorf("expected o-o.debug.miek.nl. to be debug")
}
if ok := IsDebug(strings.ToLower("o-o.Debug.miek.nl.")); ok != "miek.nl." {
t.Errorf("expected o-o.Debug.miek.nl. to be debug")
}
if ok := IsDebug("i-o.debug.miek.nl."); ok != "" {
t.Errorf("expected i-o.Debug.miek.nl. to be non-debug")
}
if ok := IsDebug(strings.ToLower("i-o.Debug.")); ok != "" {
t.Errorf("expected o-o.Debug. to be non-debug")
}
}