lb

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RoundRobin

type RoundRobin struct {
	// contains filtered or unexported fields
}

func NewRoundRobin

func NewRoundRobin() *RoundRobin

func (*RoundRobin) Index

func (r *RoundRobin) Index(lens int) (index int)

func (*RoundRobin) Pick

func (r *RoundRobin) Pick(values []string) string

type Server

type Server struct {
	Name           string
	OriginalWeight int
	CurrentWeight  int
}

type Weight

type Weight struct {
	Servers     []Server
	ModelAgents []*model.ModelAgent
	Keys        []*model.Key
	// contains filtered or unexported fields
}

func NewKeyWeight

func NewKeyWeight(keys []*model.Key) *Weight

func NewModelAgentWeight

func NewModelAgentWeight(modelAgents []*model.ModelAgent) *Weight

func NewWeight

func NewWeight(servers []Server) *Weight

func (*Weight) Pick

func (w *Weight) Pick() *Server

func (*Weight) PickKey

func (w *Weight) PickKey() *model.Key

func (*Weight) PickModelAgent

func (w *Weight) PickModelAgent() *model.ModelAgent

Jump to

Keyboard shortcuts

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