mirror of
https://github.com/coredns/coredns.git
synced 2026-07-10 17:50:12 -04:00
34 lines
810 B
Go
34 lines
810 B
Go
// Package secondary implements a secondary plugin.
|
|
package secondary
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/coredns/coredns/plugin/file"
|
|
"github.com/coredns/coredns/plugin/pkg/catalog"
|
|
)
|
|
|
|
// Secondary implements a secondary plugin that allows CoreDNS to retrieve (via AXFR)
|
|
// zone information from a primary server.
|
|
type Secondary struct {
|
|
file.File
|
|
|
|
zoneMu sync.RWMutex
|
|
zoneNames map[*file.Zone]string
|
|
dynamicZones map[string]*dynamicZone
|
|
|
|
catalogMu sync.RWMutex
|
|
catalogs map[string]*catalog.Catalog
|
|
catalogZones map[string]struct{}
|
|
catalogMemberZones map[string]map[string]struct{}
|
|
}
|
|
|
|
type dynamicZone struct {
|
|
catalog string
|
|
shutdown chan bool
|
|
stopOnce sync.Once
|
|
}
|
|
|
|
// Name implements the Handler interface.
|
|
func (s *Secondary) Name() string { return "secondary" }
|