Documentation ¶
Index ¶
- Variables
- func NewZoneLabelStats(size int) *zoneLabelStats
- type Label
- type LabelMatch
- type MuxManager
- type NilReg
- type Record
- type Records
- type RecordsByWeight
- type RegistrationAPI
- type Zone
- func (z *Zone) AddLabel(k string) *Label
- func (zone *Zone) AddSOA()
- func (z *Zone) Close()
- func (z *Zone) FindLabels(s string, targets []string, qts []uint16) []LabelMatch
- func (z *Zone) HealthRR(label string, baseLabel string) []dns.RR
- func (zone *Zone) Picker(label *Label, qtype uint16, max int, location *geo.Location) Records
- func (zone *Zone) ReadZoneFile(fileName string) (zerr error)
- func (z *Zone) SetLocations()
- func (z *Zone) SetupMetrics(old *Zone)
- func (z *Zone) SoaRR() dns.RR
- func (z *Zone) StartStopHealthTests(start bool, oldZone *Zone)
- type ZoneList
- type ZoneLogging
- type ZoneMetrics
- type ZoneOptions
Constants ¶
This section is empty.
Variables ¶
AlwaysWeighted types always honors 'MaxHosts', even without an explicit weight set. (This list is slightly arbitrary).
Functions ¶
func NewZoneLabelStats ¶
func NewZoneLabelStats(size int) *zoneLabelStats
Types ¶
type Label ¶
type LabelMatch ¶
type MuxManager ¶
type MuxManager struct {
// contains filtered or unexported fields
}
func NewMuxManager ¶
func NewMuxManager(path string, reg RegistrationAPI) (*MuxManager, error)
func (*MuxManager) Run ¶
func (mm *MuxManager) Run()
func (*MuxManager) Zones ¶
func (mm *MuxManager) Zones() ZoneList
GetZones returns the list of currently active zones in the mux manager. (todo: rename to Zones() when the Zones struct has been renamed to ZoneList)
type RecordsByWeight ¶
type RecordsByWeight struct{ Records }
func (RecordsByWeight) Less ¶
func (s RecordsByWeight) Less(i, j int) bool
type RegistrationAPI ¶
type Zone ¶
type Zone struct { Origin string Labels labelmap LabelCount int Options ZoneOptions Logging *ZoneLogging Metrics ZoneMetrics HasClosest bool HealthStatus health.Status sync.RWMutex // contains filtered or unexported fields }
func (*Zone) FindLabels ¶
func (z *Zone) FindLabels(s string, targets []string, qts []uint16) []LabelMatch
Find label "s" in country "cc" falling back to the appropriate continent and the global label name as needed. Looks for the first available qType at each targeting level. Returns a list of LabelMatch for potential labels that might satisfy the query. "MF" records are treated as aliases. The API returns all the matches the targeting will allow so health check filtering won't filter out the "best" results leaving no others.
func (*Zone) Picker ¶
Picker picks the best results from a label matching the qtype, up to 'max' results. If location is specified Picker will get return the "closests" results, otherwise they are returned weighted randomized.
func (*Zone) ReadZoneFile ¶
func (*Zone) SetLocations ¶
func (z *Zone) SetLocations()
Find the locations of all the A and AAAA records within a zone. If we were being really clever here we could use LOC records too. But for the time being we'll just use GeoIP.
func (*Zone) SetupMetrics ¶
func (*Zone) StartStopHealthTests ¶
type ZoneLogging ¶
type ZoneMetrics ¶
type ZoneMetrics struct { LabelStats *zoneLabelStats ClientStats *zoneLabelStats }