routing

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FallbackChain

type FallbackChain struct {
	Primary   string   `json:"primary"`
	Fallbacks []string `json:"fallbacks"`
	Current   int      `json:"current"`
}

type FallbackManager

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

func NewFallbackManager

func NewFallbackManager() *FallbackManager

func (*FallbackManager) GetModel

func (f *FallbackManager) GetModel(source string, statusCode int) string

func (*FallbackManager) Register

func (f *FallbackManager) Register(source, primary string, fallbacks ...string)

func (*FallbackManager) Reset

func (f *FallbackManager) Reset(source string)

type LatencyTracker

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

func NewLatencyTracker

func NewLatencyTracker() *LatencyTracker

func (*LatencyTracker) FastestModel

func (t *LatencyTracker) FastestModel() string

func (*LatencyTracker) GetP50

func (t *LatencyTracker) GetP50(model string) time.Duration

func (*LatencyTracker) GetP95

func (t *LatencyTracker) GetP95(model string) time.Duration

func (*LatencyTracker) GetP99

func (t *LatencyTracker) GetP99(model string) time.Duration

func (*LatencyTracker) Record

func (t *LatencyTracker) Record(model string, latency time.Duration)

type WeightedBalancer

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

func NewWeightedBalancer

func NewWeightedBalancer() *WeightedBalancer

func (*WeightedBalancer) AddRoute

func (b *WeightedBalancer) AddRoute(model string, weight int)

func (*WeightedBalancer) Select

func (b *WeightedBalancer) Select() string

type WeightedRoute

type WeightedRoute struct {
	Model  string `json:"model"`
	Weight int    `json:"weight"`
}

Jump to

Keyboard shortcuts

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