Commit 94dc2864 authored by Miek Gieben's avatar Miek Gieben

golint

parent 7ce71001
......@@ -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" }
......@@ -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) {
......
......@@ -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 {
......
......@@ -55,6 +55,7 @@ var (
}, []string{"type"})
)
// Name implements the Handler interface.
func (d Dnssec) Name() string { return "dnssec" }
const subsystem = "dnssec"
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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
......
......@@ -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" }
......@@ -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.
......
......@@ -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" }
......@@ -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"
......@@ -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,
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
......
......@@ -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" }
......@@ -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" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment