Documentation ¶
Index ¶
- Variables
- type LlamaCppPickedTarget
- type LlamaCppTarget
- type LlamaCppTargetConfiguration
- type LoadBalancer
- func (self *LoadBalancer) Balance(request *LoadBalancerRequest) (*url.URL, error)
- func (self *LoadBalancer) GetLlamaCppTargetForRequest(request *LoadBalancerRequest) *LlamaCppTarget
- func (self *LoadBalancer) GetStatus() *LoadBalancerStatus
- func (self *LoadBalancer) OnTick()
- func (self *LoadBalancer) RegisterOrUpdateTarget(serverEventsChannel chan<- goroutine.ResultMessage, ...)
- type LoadBalancerRequest
- type LoadBalancerStatus
- type LoadBalancerTargetCollection
- func (self *LoadBalancerTargetCollection) FixTargetOrder(target *LlamaCppTarget)
- func (self *LoadBalancerTargetCollection) GetHeadTarget() *LlamaCppPickedTarget
- func (self *LoadBalancerTargetCollection) GetTargetByConfiguration(targetConfiguration *LlamaCppTargetConfiguration) *LlamaCppTarget
- func (self *LoadBalancerTargetCollection) GetTargetWithFreeSlotsForBalancing() *LlamaCppPickedTarget
- func (self *LoadBalancerTargetCollection) Len() int
- func (self *LoadBalancerTargetCollection) RegisterTarget(llamaCppTarget *LlamaCppTarget)
- func (self *LoadBalancerTargetCollection) RemoveTarget(llamaCppTarget *LlamaCppTarget)
- type ReverseProxyServer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrorNoTargetsAvailable = errors.New("no targets available")
)
Functions ¶
This section is empty.
Types ¶
type LlamaCppPickedTarget ¶
type LlamaCppPickedTarget struct { Element *list.Element LlamaCppTarget *LlamaCppTarget }
type LlamaCppTarget ¶
type LlamaCppTarget struct { LastUpdate time.Time LlamaCppTargetConfiguration *LlamaCppTargetConfiguration LlamaCppClient *llamacpp.LlamaCppClient LlamaCppHealthStatus *llamacpp.LlamaCppHealthStatus RemainingTicksUntilRemoved int TotalUpdates int }
func (*LlamaCppTarget) HasLessSlotsThan ¶
func (self *LlamaCppTarget) HasLessSlotsThan(other *LlamaCppTarget) bool
type LlamaCppTargetConfiguration ¶
type LlamaCppTargetConfiguration struct {
LlamaCppConfiguration *llamacpp.LlamaCppConfiguration `json:"llama_cpp_configuration"`
}
func (*LlamaCppTargetConfiguration) String ¶
func (self *LlamaCppTargetConfiguration) String() string
type LoadBalancer ¶
type LoadBalancer struct { HttpClient *http.Client LoadBalancerTargetCollection *LoadBalancerTargetCollection Logger hclog.Logger }
func NewLoadBalancer ¶
func NewLoadBalancer( httpClient *http.Client, logger hclog.Logger, ) *LoadBalancer
func (*LoadBalancer) Balance ¶
func (self *LoadBalancer) Balance(request *LoadBalancerRequest) (*url.URL, error)
func (*LoadBalancer) GetLlamaCppTargetForRequest ¶
func (self *LoadBalancer) GetLlamaCppTargetForRequest(request *LoadBalancerRequest) *LlamaCppTarget
func (*LoadBalancer) GetStatus ¶
func (self *LoadBalancer) GetStatus() *LoadBalancerStatus
func (*LoadBalancer) OnTick ¶
func (self *LoadBalancer) OnTick()
func (*LoadBalancer) RegisterOrUpdateTarget ¶
func (self *LoadBalancer) RegisterOrUpdateTarget( serverEventsChannel chan<- goroutine.ResultMessage, targetConfiguration *LlamaCppTargetConfiguration, llamaCppHealthStatus *llamacpp.LlamaCppHealthStatus, )
type LoadBalancerRequest ¶
func (*LoadBalancerRequest) IsSlottable ¶
func (self *LoadBalancerRequest) IsSlottable() bool
type LoadBalancerStatus ¶
type LoadBalancerStatus struct {
RegisteredTargets int `json:"registred_targets"`
}
type LoadBalancerTargetCollection ¶
type LoadBalancerTargetCollection struct { Targets *list.List // contains filtered or unexported fields }
func (*LoadBalancerTargetCollection) FixTargetOrder ¶
func (self *LoadBalancerTargetCollection) FixTargetOrder(target *LlamaCppTarget)
func (*LoadBalancerTargetCollection) GetHeadTarget ¶
func (self *LoadBalancerTargetCollection) GetHeadTarget() *LlamaCppPickedTarget
func (*LoadBalancerTargetCollection) GetTargetByConfiguration ¶
func (self *LoadBalancerTargetCollection) GetTargetByConfiguration( targetConfiguration *LlamaCppTargetConfiguration, ) *LlamaCppTarget
func (*LoadBalancerTargetCollection) GetTargetWithFreeSlotsForBalancing ¶
func (self *LoadBalancerTargetCollection) GetTargetWithFreeSlotsForBalancing() *LlamaCppPickedTarget
func (*LoadBalancerTargetCollection) Len ¶
func (self *LoadBalancerTargetCollection) Len() int
func (*LoadBalancerTargetCollection) RegisterTarget ¶
func (self *LoadBalancerTargetCollection) RegisterTarget(llamaCppTarget *LlamaCppTarget)
func (*LoadBalancerTargetCollection) RemoveTarget ¶
func (self *LoadBalancerTargetCollection) RemoveTarget(llamaCppTarget *LlamaCppTarget)
type ReverseProxyServer ¶
type ReverseProxyServer struct { LoadBalancer *LoadBalancer Logger hclog.Logger ReverseProxyConfiguration *reverseproxy.ReverseProxyConfiguration }
func (*ReverseProxyServer) Serve ¶
func (self *ReverseProxyServer) Serve(serverEventsChannel chan<- goroutine.ResultMessage)
Click to show internal directories.
Click to hide internal directories.