aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-10-27 11:48:37 +0000
committerGravatar Miek Gieben <miek@miek.nl> 2016-10-27 11:48:37 +0000
commit94dc28646d0852541b378a627631de8c83785de8 (patch)
tree3d6dd1a8791264b7ff06f9165f17795a6333f189
parent7ce71001226ecdbac32db3f405afc7ef35f9dbfe (diff)
downloadcoredns-94dc28646d0852541b378a627631de8c83785de8.tar.gz
coredns-94dc28646d0852541b378a627631de8c83785de8.tar.zst
coredns-94dc28646d0852541b378a627631de8c83785de8.zip
golint
-rw-r--r--middleware/auto/auto.go1
-rw-r--r--middleware/cache/handler.go1
-rw-r--r--middleware/chaos/chaos.go1
-rw-r--r--middleware/dnssec/handler.go1
-rw-r--r--middleware/etcd/handler.go1
-rw-r--r--middleware/file/file.go1
-rw-r--r--middleware/kubernetes/handler.go1
-rw-r--r--middleware/kubernetes/nametemplate/nametemplate.go7
-rw-r--r--middleware/loadbalance/handler.go1
-rw-r--r--middleware/log/log.go1
-rw-r--r--middleware/metrics/handler.go1
-rw-r--r--middleware/metrics/setup.go1
-rw-r--r--middleware/metrics/vars/vars.go1
-rw-r--r--middleware/middleware.go1
-rw-r--r--middleware/proxy/proxy.go1
-rw-r--r--middleware/rewrite/rewrite.go1
-rw-r--r--middleware/test/helpers.go1
-rw-r--r--middleware/whoami/whoami.go1
18 files changed, 21 insertions, 3 deletions
diff --git a/middleware/auto/auto.go b/middleware/auto/auto.go
index 65e784459..11d138a7a 100644
--- a/middleware/auto/auto.go
+++ b/middleware/auto/auto.go
@@ -100,4 +100,5 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
return dns.RcodeSuccess, nil
}
+// Name implements the Handler interface.
func (a Auto) Name() string { return "auto" }
diff --git a/middleware/cache/handler.go b/middleware/cache/handler.go
index 95b51970e..9c3615e80 100644
--- a/middleware/cache/handler.go
+++ b/middleware/cache/handler.go
@@ -37,6 +37,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
return c.Next.ServeDNS(ctx, crr, r)
}
+// Name implements the Handler interface.
func (c *Cache) Name() string { return "cache" }
func (c *Cache) get(qname string, qtype uint16, do bool) (*item, bool, bool) {
diff --git a/middleware/chaos/chaos.go b/middleware/chaos/chaos.go
index 39ebe7f49..730ef21b5 100644
--- a/middleware/chaos/chaos.go
+++ b/middleware/chaos/chaos.go
@@ -51,6 +51,7 @@ func (c Chaos) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
return 0, nil
}
+// Name implements the Handler interface.
func (c Chaos) Name() string { return "chaos" }
func trim(s string) string {
diff --git a/middleware/dnssec/handler.go b/middleware/dnssec/handler.go
index a99588397..1ea981a73 100644
--- a/middleware/dnssec/handler.go
+++ b/middleware/dnssec/handler.go
@@ -55,6 +55,7 @@ var (
}, []string{"type"})
)
+// Name implements the Handler interface.
func (d Dnssec) Name() string { return "dnssec" }
const subsystem = "dnssec"
diff --git a/middleware/etcd/handler.go b/middleware/etcd/handler.go
index 7c856bd8b..ac9820046 100644
--- a/middleware/etcd/handler.go
+++ b/middleware/etcd/handler.go
@@ -117,6 +117,7 @@ func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
return dns.RcodeSuccess, nil
}
+// Name implements the Handler interface.
func (e *Etcd) Name() string { return "etcd" }
// Err write an error response to the client.
diff --git a/middleware/file/file.go b/middleware/file/file.go
index 7c6a65ced..db15b30a5 100644
--- a/middleware/file/file.go
+++ b/middleware/file/file.go
@@ -110,6 +110,7 @@ func (f File) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
return dns.RcodeSuccess, nil
}
+// Name implements the Handler interface.
func (f File) Name() string { return "file" }
// Parse parses the zone in filename and returns a new Zone or an error.
diff --git a/middleware/kubernetes/handler.go b/middleware/kubernetes/handler.go
index cc59a305f..95009a04b 100644
--- a/middleware/kubernetes/handler.go
+++ b/middleware/kubernetes/handler.go
@@ -101,6 +101,7 @@ func (k Kubernetes) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.M
return dns.RcodeSuccess, nil
}
+// Name implements the Handler interface.
func (k Kubernetes) Name() string { return "kubernetes" }
// Err writes an error response back to the client.
diff --git a/middleware/kubernetes/nametemplate/nametemplate.go b/middleware/kubernetes/nametemplate/nametemplate.go
index 1ddfea1da..328572497 100644
--- a/middleware/kubernetes/nametemplate/nametemplate.go
+++ b/middleware/kubernetes/nametemplate/nametemplate.go
@@ -61,7 +61,7 @@ var requiredSymbols = []string{
// symbol consumes the other segments. Most likely this would be the servicename.
// Also consider how to handle static strings in the format template.
-// TODO(infoblox): docs
+// Template holds the kubernetes template.
type Template struct {
formatString string
splitFormat []string
@@ -69,7 +69,7 @@ type Template struct {
Element map[string]int
}
-// TODO(infoblox): docs
+// SetTemplate use the string s the set the template.
func (t *Template) SetTemplate(s string) error {
var err error
@@ -185,7 +185,8 @@ func (t *Template) IsValid() bool {
return result
}
-// TODO(infoblox): what's this?
+// NameValues contains a number of values.
+// TODO(...): better docs.
type NameValues struct {
ServiceName string
Namespace string
diff --git a/middleware/loadbalance/handler.go b/middleware/loadbalance/handler.go
index 8cba67e6f..9f9cfb766 100644
--- a/middleware/loadbalance/handler.go
+++ b/middleware/loadbalance/handler.go
@@ -19,4 +19,5 @@ func (rr RoundRobin) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
return rr.Next.ServeDNS(ctx, wrr, r)
}
+// Name implements the Handler interface.
func (rr RoundRobin) Name() string { return "loadbalance" }
diff --git a/middleware/log/log.go b/middleware/log/log.go
index 0a3cca130..e099eced7 100644
--- a/middleware/log/log.go
+++ b/middleware/log/log.go
@@ -64,6 +64,7 @@ func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
return l.Next.ServeDNS(ctx, w, r)
}
+// Name implements the Handler interface.
func (l Logger) Name() string { return "log" }
// Rule configures the logging middleware.
diff --git a/middleware/metrics/handler.go b/middleware/metrics/handler.go
index 4c235ab6a..ff8aa059f 100644
--- a/middleware/metrics/handler.go
+++ b/middleware/metrics/handler.go
@@ -30,4 +30,5 @@ func (m *Metrics) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
return status, err
}
+// Name implements the Handler interface.
func (m *Metrics) Name() string { return "prometheus" }
diff --git a/middleware/metrics/setup.go b/middleware/metrics/setup.go
index 93a6bf50a..6c52aead3 100644
--- a/middleware/metrics/setup.go
+++ b/middleware/metrics/setup.go
@@ -87,4 +87,5 @@ func prometheusParse(c *caddy.Controller) (*Metrics, error) {
var metricsOnce sync.Once
+// Addr is the address the where the metrics are exported by default.
const Addr = "localhost:9153"
diff --git a/middleware/metrics/vars/vars.go b/middleware/metrics/vars/vars.go
index 935b6f810..2604e2345 100644
--- a/middleware/metrics/vars/vars.go
+++ b/middleware/metrics/vars/vars.go
@@ -6,6 +6,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
)
+// Request* and Reponse* are the prometheus counters and gauges we are using for exporting metrics.
var (
RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: middleware.Namespace,
diff --git a/middleware/middleware.go b/middleware/middleware.go
index bdc8bc2fe..47d732f4d 100644
--- a/middleware/middleware.go
+++ b/middleware/middleware.go
@@ -59,6 +59,7 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
return f(ctx, w, r)
}
+// Name implements the Handler interface.
func (f HandlerFunc) Name() string { return "handlerfunc" }
// Error returns err with 'middleware/name: ' prefixed to it.
diff --git a/middleware/proxy/proxy.go b/middleware/proxy/proxy.go
index 1ff0a2f30..aa58f4dbe 100644
--- a/middleware/proxy/proxy.go
+++ b/middleware/proxy/proxy.go
@@ -102,6 +102,7 @@ func (p Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
return p.Next.ServeDNS(ctx, w, r)
}
+// Name implements the Handler interface.
func (p Proxy) Name() string { return "proxy" }
// defaultTimeout is the default networking timeout for DNS requests.
diff --git a/middleware/rewrite/rewrite.go b/middleware/rewrite/rewrite.go
index 2498d4c34..ad28287ac 100644
--- a/middleware/rewrite/rewrite.go
+++ b/middleware/rewrite/rewrite.go
@@ -52,6 +52,7 @@ func (rw Rewrite) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
return rw.Next.ServeDNS(ctx, w, r)
}
+// Name implements the Handler interface.
func (rw Rewrite) Name() string { return "rewrite" }
// Rule describes an internal location rewrite rule.
diff --git a/middleware/test/helpers.go b/middleware/test/helpers.go
index 0137171a7..66fc3c50c 100644
--- a/middleware/test/helpers.go
+++ b/middleware/test/helpers.go
@@ -292,4 +292,5 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
return f(ctx, w, r)
}
+// Name implements the Handler interface.
func (f HandlerFunc) Name() string { return "handlerfunc" }
diff --git a/middleware/whoami/whoami.go b/middleware/whoami/whoami.go
index 0ef63325f..c86d462c8 100644
--- a/middleware/whoami/whoami.go
+++ b/middleware/whoami/whoami.go
@@ -56,4 +56,5 @@ func (wh Whoami) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
return 0, nil
}
+// Name implements the Handler interface.
func (wh Whoami) Name() string { return "whoami" }