distributor

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface[T any] interface {
	Next() T
}

func NewRoundRobin

func NewRoundRobin[T any](resources []T) Interface[T]

func NewWeightedRoundRobin

func NewWeightedRoundRobin[T any](resources []WeightedResource[T]) Interface[T]

type RoundRobin

type RoundRobin[T any] struct {
	// contains filtered or unexported fields
}

func (*RoundRobin[T]) Next

func (r *RoundRobin[T]) Next() T

type WeightedResource

type WeightedResource[T any] struct {
	R      T
	Weight int
	// contains filtered or unexported fields
}

type WeightedRoundRobin

type WeightedRoundRobin[T any] struct {
	// contains filtered or unexported fields
}

func (*WeightedRoundRobin[T]) Next

func (r *WeightedRoundRobin[T]) Next() T

Jump to

Keyboard shortcuts

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