Documentation
¶
Index ¶
- func BaseRouteAttrs(p *config.PolicyConfig) model.RouteAttrs
- func Evaluate(healthy bool, lowerPriorityFilePresent bool, p *config.PolicyConfig) model.VIPState
- func RouteAttrsFor(p *config.PolicyConfig, state model.VIPState) model.RouteAttrs
- type BGPNotifier
- type Manager
- func (m *Manager) CombineChecks(vipName string, healthy map[string]bool) (result, ok bool)
- func (m *Manager) GetVIPStatuses() []model.VIPStatus
- func (m *Manager) OnCheckResult(vipName, checkName string, result checks.Result)
- func (m *Manager) OnHealthTransition(t checks.HealthTransition)
- func (m *Manager) SetTransitionListener(fn func())
- type StateChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseRouteAttrs ¶ added in v0.11.0
func BaseRouteAttrs(p *config.PolicyConfig) model.RouteAttrs
BaseRouteAttrs returns the attributes from the announce block: the base prepend and communities carried by every announcement of the VIP.
func RouteAttrsFor ¶ added in v0.11.0
func RouteAttrsFor(p *config.PolicyConfig, state model.VIPState) model.RouteAttrs
RouteAttrsFor returns the BGP attributes to originate the VIP with in the given state:
- announced: the announce block (base prepend + communities)
- pessimized: base prepend + lower_priority prepend, and the union of both community lists, so a degraded node never outranks a healthy node with a larger base prepend
- withdrawn: zero value (no route)
Types ¶
type BGPNotifier ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) CombineChecks ¶ added in v0.12.0
CombineChecks applies the VIP's checks_policy to an ad-hoc per-check outcome (e.g. a triggered run). ok is false for an unknown VIP.
func (*Manager) GetVIPStatuses ¶
func (*Manager) OnCheckResult ¶
func (*Manager) OnHealthTransition ¶
func (m *Manager) OnHealthTransition(t checks.HealthTransition)
func (*Manager) SetTransitionListener ¶ added in v0.12.0
func (m *Manager) SetTransitionListener(fn func())
SetTransitionListener registers fn to be called after each VIP state transition. It must be set before the schedulers start.
Click to show internal directories.
Click to hide internal directories.