mirror of
https://github.com/coredns/coredns.git
synced 2025-11-18 18:02:16 -05:00
map bool -> map struct{} (#2386)
This clear out the remaining map[x]bool usage and moves the bool to an empty struct. Two note worthy other changes: * EnableChaos in the server is now also exported to make it show up in the documentation. * The auto plugin is left as is, because there the boolean is explicitaly set to false to signal 'to-be-deleted' and the key is left as-is. Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
@@ -55,7 +55,9 @@ func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||
class := response.Classify(tpe)
|
||||
// If we don't set up a class in config, the default "all" will be added
|
||||
// and we shouldn't have an empty rule.Class.
|
||||
if rule.Class[response.All] || rule.Class[class] {
|
||||
_, ok := rule.Class[response.All]
|
||||
_, ok1 := rule.Class[class]
|
||||
if ok || ok1 {
|
||||
rep := replacer.New(ctx, r, rrw, CommonLogEmptyValue)
|
||||
clog.Infof(rep.Replace(rule.Format))
|
||||
}
|
||||
@@ -72,7 +74,7 @@ func (l Logger) Name() string { return "log" }
|
||||
// Rule configures the logging plugin.
|
||||
type Rule struct {
|
||||
NameScope string
|
||||
Class map[response.Class]bool
|
||||
Class map[response.Class]struct{}
|
||||
Format string
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user