plugin/metadata: finish documentation (#1951)

* plugin/metadata: finish documentation

Finish the README.md, add corner case in the IsLabel test and reword
some code comments slightly.

Generate the man-pages and add man/coredns-metadata.7 as well.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix test

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben
2018-07-09 07:58:14 +01:00
committed by GitHub
parent b3a92f1622
commit b27a59c160
5 changed files with 86 additions and 15 deletions

View File

@@ -49,7 +49,7 @@ type Provider interface {
// Func is the type of function in the metadata, when called they return the value of the label.
type Func func() string
// IsLabel check that the provided name looks like a valid label name
// IsLabel checks that the provided name is a valid label name, i.e. two words separated by a slash.
func IsLabel(label string) bool {
p := strings.Index(label, "/")
if p <= 0 || p >= len(label)-1 {