doc: some function/vars/const/package level updates (#1558)
* doc: some function/vars/const/package level updates Various update that stood out while reading godoc.org for CoreDNS. * Fix some misspellings as well
This commit is contained in:
parent
e3b7beab6a
commit
455040c143
9 changed files with 12 additions and 8 deletions
|
@ -73,7 +73,7 @@ func normalizeZone(str string) (zoneAddr, error) {
|
||||||
return zoneAddr{Zone: dns.Fqdn(host), Port: port, Transport: trans, IPNet: ipnet}, nil
|
return zoneAddr{Zone: dns.Fqdn(host), Port: port, Transport: trans, IPNet: ipnet}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// SplitProtocolHostPort - split a full formed address like "dns://[::1}:53" into parts
|
// SplitProtocolHostPort splits a full formed address like "dns://[::1]:53" into parts.
|
||||||
func SplitProtocolHostPort(address string) (protocol string, ip string, port string, err error) {
|
func SplitProtocolHostPort(address string) (protocol string, ip string, port string, err error) {
|
||||||
parts := strings.Split(address, "://")
|
parts := strings.Split(address, "://")
|
||||||
switch len(parts) {
|
switch len(parts) {
|
||||||
|
|
|
@ -251,9 +251,11 @@ var (
|
||||||
buildDate string // date -u
|
buildDate string // date -u
|
||||||
gitTag string // git describe --exact-match HEAD 2> /dev/null
|
gitTag string // git describe --exact-match HEAD 2> /dev/null
|
||||||
gitNearestTag string // git describe --abbrev=0 --tags HEAD
|
gitNearestTag string // git describe --abbrev=0 --tags HEAD
|
||||||
GitCommit string // git rev-parse HEAD
|
|
||||||
gitShortStat string // git diff-index --shortstat
|
gitShortStat string // git diff-index --shortstat
|
||||||
gitFilesModified string // git diff-index --name-only HEAD
|
gitFilesModified string // git diff-index --name-only HEAD
|
||||||
|
|
||||||
|
// Gitcommit contains the commit where we built CoreDNS from.
|
||||||
|
GitCommit string
|
||||||
)
|
)
|
||||||
|
|
||||||
// flagsBlacklist removes flags with these names from our flagset.
|
// flagsBlacklist removes flags with these names from our flagset.
|
||||||
|
|
|
@ -45,7 +45,7 @@ var (
|
||||||
Namespace: plugin.Namespace,
|
Namespace: plugin.Namespace,
|
||||||
Subsystem: "forward",
|
Subsystem: "forward",
|
||||||
Name: "socket_count_total",
|
Name: "socket_count_total",
|
||||||
Help: "Guage of open sockets per upstream.",
|
Help: "Gauge of open sockets per upstream.",
|
||||||
}, []string{"to"})
|
}, []string{"to"})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ func init() {
|
||||||
func setup(c *caddy.Controller) error {
|
func setup(c *caddy.Controller) error {
|
||||||
f, err := parseForward(c)
|
f, err := parseForward(c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return plugin.Error("foward", err)
|
return plugin.Error("forward", err)
|
||||||
}
|
}
|
||||||
if f.Len() > max {
|
if f.Len() > max {
|
||||||
return plugin.Error("forward", fmt.Errorf("more than %d TOs configured: %d", max, f.Len()))
|
return plugin.Error("forward", fmt.Errorf("more than %d TOs configured: %d", max, f.Len()))
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package fuzz contains functions that enable fuzzing of plugins.
|
||||||
package fuzz
|
package fuzz
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
// Package parse contains functions that can be used in the setup code for plugins.
|
||||||
package parse
|
package parse
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -6,8 +6,7 @@ import (
|
||||||
"github.com/miekg/dns"
|
"github.com/miekg/dns"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ToString convert the rcode to the official DNS string, or to "RCODE"+value if the RCODE
|
// ToString convert the rcode to the official DNS string, or to "RCODE"+value if the RCODE value is unknown.
|
||||||
// value is unknown.
|
|
||||||
func ToString(rcode int) string {
|
func ToString(rcode int) string {
|
||||||
if str, ok := dns.RcodeToString[rcode]; ok {
|
if str, ok := dns.RcodeToString[rcode]; ok {
|
||||||
return str
|
return str
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// Package up is used to run a function for some duration. If a new function is added while a previous run is
|
||||||
|
// still ongoing, nothing new will be executed.
|
||||||
package up
|
package up
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
// Package request abstracts a client's request so that all plugin
|
// Package request abstracts a client's request so that all plugins will handle them in an unified way.
|
||||||
// will handle them in an unified way.
|
|
||||||
package request
|
package request
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue