diff options
author | 2018-07-01 20:01:17 +0100 | |
---|---|---|
committer | 2018-07-01 20:01:17 +0100 | |
commit | 99800a687c5da6b5b9c42ad0431e21151828612a (patch) | |
tree | 447d777a8e9c3763cb418de2e9c065c7d91e43bc /plugin/metadata/setup.go | |
parent | 0b326e26865af91474703322d5d9b1eb1e45a8ff (diff) | |
download | coredns-99800a687c5da6b5b9c42ad0431e21151828612a.tar.gz coredns-99800a687c5da6b5b9c42ad0431e21151828612a.tar.zst coredns-99800a687c5da6b5b9c42ad0431e21151828612a.zip |
plugin/metadata: metadata is just label=value (#1914)
This revert 17d807f0 and re-adds the metadata plugin as a plugin that
just sets a label to a value function.
Add package documentation on how to use the metadata package. Make it
clear that any caching is up to the Func implemented.
There are now - no in tree users. We could add the request metadata by
default under names that copy request.Request, i.e
request/ip - remote IP
request/port - remote port
Variables.go has been deleted.
Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/metadata/setup.go')
-rw-r--r-- | plugin/metadata/setup.go | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/plugin/metadata/setup.go b/plugin/metadata/setup.go index 33a153a2c..282bcf7d9 100644 --- a/plugin/metadata/setup.go +++ b/plugin/metadata/setup.go @@ -1,8 +1,6 @@ package metadata import ( - "fmt" - "github.com/coredns/coredns/core/dnsserver" "github.com/coredns/coredns/plugin" @@ -28,16 +26,8 @@ func setup(c *caddy.Controller) error { c.OnStartup(func() error { plugins := dnsserver.GetConfig(c).Handlers() - // Collect all plugins which implement Provider interface - metadataVariables := map[string]bool{} for _, p := range plugins { if met, ok := p.(Provider); ok { - for _, varName := range met.MetadataVarNames() { - if _, ok := metadataVariables[varName]; ok { - return fmt.Errorf("Metadata variable '%v' has duplicates", varName) - } - metadataVariables[varName] = true - } m.Providers = append(m.Providers, met) } } |