2017-09-14 09:36:06 +01:00
|
|
|
// Package secondary implements a secondary plugin.
|
|
|
|
|
package secondary
|
|
|
|
|
|
2026-07-05 08:06:05 +08:00
|
|
|
import (
|
|
|
|
|
"sync"
|
|
|
|
|
|
|
|
|
|
"github.com/coredns/coredns/plugin/file"
|
|
|
|
|
"github.com/coredns/coredns/plugin/pkg/catalog"
|
|
|
|
|
)
|
2017-09-14 09:36:06 +01:00
|
|
|
|
|
|
|
|
// Secondary implements a secondary plugin that allows CoreDNS to retrieve (via AXFR)
|
|
|
|
|
// zone information from a primary server.
|
|
|
|
|
type Secondary struct {
|
|
|
|
|
file.File
|
2026-07-05 08:06:05 +08:00
|
|
|
|
|
|
|
|
catalogMu sync.RWMutex
|
|
|
|
|
catalogs map[string]*catalog.Catalog
|
|
|
|
|
catalogZones map[string]struct{}
|
2017-09-14 09:36:06 +01:00
|
|
|
}
|
2023-07-30 10:38:12 -03:00
|
|
|
|
|
|
|
|
// Name implements the Handler interface.
|
2026-07-05 08:06:05 +08:00
|
|
|
func (s *Secondary) Name() string { return "secondary" }
|