mirror of
https://github.com/coredns/coredns.git
synced 2026-08-20 23:08:28 -04:00
* plugin/secondary: support catalog zone ownership migration Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com> * plugin/secondary: scope catalog member zones Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com> --------- Signed-off-by: houyuwushang <liuluoqianqiu@outlook.com>
36 lines
868 B
Go
36 lines
868 B
Go
// Package secondary implements a secondary plugin.
|
|
package secondary
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/coredns/coredns/plugin"
|
|
"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]plugin.Zones
|
|
catalogMemberZones map[string]map[string]struct{}
|
|
}
|
|
|
|
type dynamicZone struct {
|
|
catalog string
|
|
memberID string
|
|
shutdown chan bool
|
|
stopOnce sync.Once
|
|
}
|
|
|
|
// Name implements the Handler interface.
|
|
func (s *Secondary) Name() string { return "secondary" }
|