golint
This commit is contained in:
parent
7ce7100122
commit
94dc28646d
18 changed files with 21 additions and 3 deletions
|
@ -100,4 +100,5 @@ func (a Auto) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (i
|
||||||
return dns.RcodeSuccess, nil
|
return dns.RcodeSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (a Auto) Name() string { return "auto" }
|
func (a Auto) Name() string { return "auto" }
|
||||||
|
|
1
middleware/cache/handler.go
vendored
1
middleware/cache/handler.go
vendored
|
@ -37,6 +37,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||||
return c.Next.ServeDNS(ctx, crr, r)
|
return c.Next.ServeDNS(ctx, crr, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (c *Cache) Name() string { return "cache" }
|
func (c *Cache) Name() string { return "cache" }
|
||||||
|
|
||||||
func (c *Cache) get(qname string, qtype uint16, do bool) (*item, bool, bool) {
|
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
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (c Chaos) Name() string { return "chaos" }
|
func (c Chaos) Name() string { return "chaos" }
|
||||||
|
|
||||||
func trim(s string) string {
|
func trim(s string) string {
|
||||||
|
|
|
@ -55,6 +55,7 @@ var (
|
||||||
}, []string{"type"})
|
}, []string{"type"})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (d Dnssec) Name() string { return "dnssec" }
|
func (d Dnssec) Name() string { return "dnssec" }
|
||||||
|
|
||||||
const subsystem = "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
|
return dns.RcodeSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (e *Etcd) Name() string { return "etcd" }
|
func (e *Etcd) Name() string { return "etcd" }
|
||||||
|
|
||||||
// Err write an error response to the client.
|
// 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
|
return dns.RcodeSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (f File) Name() string { return "file" }
|
func (f File) Name() string { return "file" }
|
||||||
|
|
||||||
// Parse parses the zone in filename and returns a new Zone or an error.
|
// 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
|
return dns.RcodeSuccess, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (k Kubernetes) Name() string { return "kubernetes" }
|
func (k Kubernetes) Name() string { return "kubernetes" }
|
||||||
|
|
||||||
// Err writes an error response back to the client.
|
// 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.
|
// symbol consumes the other segments. Most likely this would be the servicename.
|
||||||
// Also consider how to handle static strings in the format template.
|
// Also consider how to handle static strings in the format template.
|
||||||
|
|
||||||
// TODO(infoblox): docs
|
// Template holds the kubernetes template.
|
||||||
type Template struct {
|
type Template struct {
|
||||||
formatString string
|
formatString string
|
||||||
splitFormat []string
|
splitFormat []string
|
||||||
|
@ -69,7 +69,7 @@ type Template struct {
|
||||||
Element map[string]int
|
Element map[string]int
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(infoblox): docs
|
// SetTemplate use the string s the set the template.
|
||||||
func (t *Template) SetTemplate(s string) error {
|
func (t *Template) SetTemplate(s string) error {
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
@ -185,7 +185,8 @@ func (t *Template) IsValid() bool {
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(infoblox): what's this?
|
// NameValues contains a number of values.
|
||||||
|
// TODO(...): better docs.
|
||||||
type NameValues struct {
|
type NameValues struct {
|
||||||
ServiceName string
|
ServiceName string
|
||||||
Namespace 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)
|
return rr.Next.ServeDNS(ctx, wrr, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (rr RoundRobin) Name() string { return "loadbalance" }
|
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)
|
return l.Next.ServeDNS(ctx, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (l Logger) Name() string { return "log" }
|
func (l Logger) Name() string { return "log" }
|
||||||
|
|
||||||
// Rule configures the logging middleware.
|
// 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
|
return status, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (m *Metrics) Name() string { return "prometheus" }
|
func (m *Metrics) Name() string { return "prometheus" }
|
||||||
|
|
|
@ -87,4 +87,5 @@ func prometheusParse(c *caddy.Controller) (*Metrics, error) {
|
||||||
|
|
||||||
var metricsOnce sync.Once
|
var metricsOnce sync.Once
|
||||||
|
|
||||||
|
// Addr is the address the where the metrics are exported by default.
|
||||||
const Addr = "localhost:9153"
|
const Addr = "localhost:9153"
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"github.com/prometheus/client_golang/prometheus"
|
"github.com/prometheus/client_golang/prometheus"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Request* and Reponse* are the prometheus counters and gauges we are using for exporting metrics.
|
||||||
var (
|
var (
|
||||||
RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
|
RequestCount = prometheus.NewCounterVec(prometheus.CounterOpts{
|
||||||
Namespace: middleware.Namespace,
|
Namespace: middleware.Namespace,
|
||||||
|
|
|
@ -59,6 +59,7 @@ func (f HandlerFunc) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
|
||||||
return f(ctx, w, r)
|
return f(ctx, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (f HandlerFunc) Name() string { return "handlerfunc" }
|
func (f HandlerFunc) Name() string { return "handlerfunc" }
|
||||||
|
|
||||||
// Error returns err with 'middleware/name: ' prefixed to it.
|
// 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)
|
return p.Next.ServeDNS(ctx, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (p Proxy) Name() string { return "proxy" }
|
func (p Proxy) Name() string { return "proxy" }
|
||||||
|
|
||||||
// defaultTimeout is the default networking timeout for DNS requests.
|
// 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)
|
return rw.Next.ServeDNS(ctx, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (rw Rewrite) Name() string { return "rewrite" }
|
func (rw Rewrite) Name() string { return "rewrite" }
|
||||||
|
|
||||||
// Rule describes an internal location rewrite rule.
|
// 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)
|
return f(ctx, w, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (f HandlerFunc) Name() string { return "handlerfunc" }
|
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
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Name implements the Handler interface.
|
||||||
func (wh Whoami) Name() string { return "whoami" }
|
func (wh Whoami) Name() string { return "whoami" }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue