Documentation ¶
Index ¶
- Variables
- func Sort[C any](ctx context.Context, clients *Clients[C], sortValueFetch SortValueFetcher[C], ...) error
- func WithClients[C any, V any](clients *Clients[C], f func(context.Context, C) (v V, err error)) (v V, err error)
- type Clients
- type RollingStrategy
- type RollingStrategyAlwaysUseFirst
- type SortDirection
- type SortValueFetcher
- type StickyRollingStrategy
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNoMoreClient = errors.New("no more clients")
Functions ¶
func Sort ¶ added in v1.6.8
func Sort[C any](ctx context.Context, clients *Clients[C], sortValueFetch SortValueFetcher[C], direction SortDirection) error
Types ¶
type Clients ¶
type Clients[C any] struct { // contains filtered or unexported fields }
func NewClients ¶
func (*Clients[C]) StartSorting ¶ added in v1.6.8
func (c *Clients[C]) StartSorting(ctx context.Context, direction SortDirection, sortValueFetcher SortValueFetcher[C], every time.Duration)
type RollingStrategy ¶ added in v1.6.8
type RollingStrategy[C any] interface { // contains filtered or unexported methods }
type RollingStrategyAlwaysUseFirst ¶ added in v1.6.8
type RollingStrategyAlwaysUseFirst[C any] struct { // contains filtered or unexported fields }
func NewRollingStrategyAlwaysUseFirst ¶ added in v1.6.8
func NewRollingStrategyAlwaysUseFirst[C any]() *RollingStrategyAlwaysUseFirst[C]
type SortDirection ¶ added in v1.6.8
type SortDirection int
const ( SortDirectionAscending SortDirection = iota SortDirectionDescending )
type SortValueFetcher ¶ added in v1.6.8
type StickyRollingStrategy ¶ added in v1.6.8
type StickyRollingStrategy[C any] struct { // contains filtered or unexported fields }
func NewStickyRollingStrategy ¶ added in v1.6.8
func NewStickyRollingStrategy[C any]() *StickyRollingStrategy[C]
Click to show internal directories.
Click to hide internal directories.