selector

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMaxFails    = 1
	DefaultFailTimeout = 10 * time.Second
)

default options for FailFilter

Variables

This section is empty.

Functions

func BackupFilter

func BackupFilter[T any]() selector.Filter[T]

BackupFilter filters the backup objects. An object is marked as backup if its metadata has backup flag.

func FIFOStrategy

func FIFOStrategy[T any]() selector.Strategy[T]

FIFOStrategy is a strategy for node selector. The node will be selected from first to last, and will stick to the selected node until it is failed.

func FailFilter

func FailFilter[T any](maxFails int, timeout time.Duration) selector.Filter[T]

FailFilter filters the dead objects. An object is marked as dead if its failed count is greater than MaxFails.

func HashStrategy

func HashStrategy[T any]() selector.Strategy[T]

func NewSelector

func NewSelector[T any](strategy selector.Strategy[T], filters ...selector.Filter[T]) selector.Selector[T]

func RandomStrategy

func RandomStrategy[T any]() selector.Strategy[T]

RandomStrategy is a strategy for node selector. The node will be selected randomly.

func RoundRobinStrategy

func RoundRobinStrategy[T any]() selector.Strategy[T]

RoundRobinStrategy is a strategy for node selector. The node will be selected by round-robin algorithm.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL