Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tracker ¶
type Tracker struct {
// contains filtered or unexported fields
}
Tracker tracks mastership of a collection of resources.
func NewTracker ¶
func NewTracker(factory election2.Factory, maxHold time.Duration, metricFactory monitoring.MetricFactory) *Tracker
NewTracker returns a new mastership tracker.
func (*Tracker) AddResource ¶
AddResource makes the mastership tracker aware of new resources. The same resource may be added an unlimited number of times.
func (*Tracker) Masterships ¶
Masterships returns a map of resources to mastership contexts. Callers should cancel ctx when they no longer are actively using mastership. If Masterships is not called periodically, we may retain masterships for longer than maxHold.
Click to show internal directories.
Click to hide internal directories.