Documentation
¶
Overview ¶
Package selector defines generic interfaces for node selection with support for strategies, filters, and failure marking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
Filter narrows a list of items to those that pass the filter criteria. Filters are applied before the selection strategy.
type Markable ¶
type Markable interface {
Marker() Marker
}
Markable exposes a Marker for health tracking. Nodes implement this so that selectors can temporarily skip failed nodes.
type Marker ¶
type Marker interface {
// Time returns the timestamp of the last failure.
Time() time.Time
// Count returns the number of consecutive failures.
Count() int64
// Mark records a failure.
Mark()
// Reset clears the failure state.
Reset()
}
Marker tracks failure state for a selectable item. When a node fails, it is marked; the selection strategy can then deprioritize or skip marked nodes until they recover.
func NewFailMarker ¶
func NewFailMarker() Marker
NewFailMarker creates a new Marker for tracking node failures.