Documentation
¶
Index ¶
- Constants
- func Algorithms() []string
- func IsValidAlgorithm(name string) bool
- type BaseFactory
- type Factory
- type HealthStatus
- type LoadBalancer
- func (lb *LoadBalancer) Close()
- func (lb *LoadBalancer) NextBackend(req *infracontext.RequestContext, exclude map[ids.RegistryID]struct{}) (*registry.Registry, error)
- func (lb *LoadBalancer) ReportFailure(b *registry.Registry, err error)
- func (lb *LoadBalancer) ReportSuccess(b *registry.Registry)
- func (lb *LoadBalancer) UpdateBackendHealth(b *registry.Registry, healthy bool, err error)
- type Pool
- type Strategy
- type StrategyInput
Constants ¶
View Source
const ( AlgorithmRoundRobin = algorithm.RoundRobin AlgorithmRandom = algorithm.Random AlgorithmWeightedRoundRobin = algorithm.WeightedRoundRobin AlgorithmLeastConnections = algorithm.LeastConnections AlgorithmSemantic = algorithm.Semantic )
Variables ¶
This section is empty.
Functions ¶
func Algorithms ¶
func Algorithms() []string
func IsValidAlgorithm ¶
Types ¶
type BaseFactory ¶
type BaseFactory struct {
// contains filtered or unexported fields
}
func (*BaseFactory) CreateStrategy ¶
func (f *BaseFactory) CreateStrategy(input StrategyInput) (Strategy, error)
type Factory ¶
type Factory interface {
CreateStrategy(input StrategyInput) (Strategy, error)
}
func NewBaseFactory ¶
func NewBaseFactory( embeddingRepo embedding.Repository, serviceLocator factory.EmbeddingServiceLocator, ) Factory
type HealthStatus ¶
type LoadBalancer ¶
type LoadBalancer struct {
// contains filtered or unexported fields
}
func NewLoadBalancer ¶
func (*LoadBalancer) Close ¶
func (lb *LoadBalancer) Close()
func (*LoadBalancer) NextBackend ¶
func (lb *LoadBalancer) NextBackend( req *infracontext.RequestContext, exclude map[ids.RegistryID]struct{}, ) (*registry.Registry, error)
func (*LoadBalancer) ReportFailure ¶
func (lb *LoadBalancer) ReportFailure(b *registry.Registry, err error)
func (*LoadBalancer) ReportSuccess ¶
func (lb *LoadBalancer) ReportSuccess(b *registry.Registry)
func (*LoadBalancer) UpdateBackendHealth ¶
func (lb *LoadBalancer) UpdateBackendHealth(b *registry.Registry, healthy bool, err error)
type Pool ¶
type Pool struct {
ID string
Registries []*registry.Registry
Weights map[ids.RegistryID]int
Algorithm string
EmbeddingConfig *registry.EmbeddingConfig
}
type Strategy ¶
type Strategy interface {
Next(req *infracontext.RequestContext, exclude map[ids.RegistryID]struct{}) *registry.Registry
Name() string
}
type StrategyInput ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.