management

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRespondToStatic

func NewRespondToStatic() http.Handler

Types

type Client

type Client struct {
	HttpClient                    *http.Client
	ManagementServerConfiguration *ManagementServerConfiguration
}

func (*Client) ReportLlamaCppHealthStatus

func (self *Client) ReportLlamaCppHealthStatus(
	ctx context.Context,
	serverEventsChannel chan<- goroutine.ResultMessage,
	llamaCppConfiguration *llamacpp.LlamaCppConfiguration,
	llamaCppHealthStatus *llamacpp.LlamaCppHealthStatus,
)

type ManagementServerConfiguration

type ManagementServerConfiguration struct {
	EnableDashboard bool
	HttpAddress     *netcfg.HttpAddressConfiguration
}

type RegisterTargetRequest

type RegisterTargetRequest struct {
	LlamaCppHealthStatus        *llamacpp.LlamaCppHealthStatus            `json:"llama_cpp_health_status"`
	LlamaCppTargetConfiguration *loadbalancer.LlamaCppTargetConfiguration `json:"llama_cpp_target_configuration"`
}

type RespondToDashboard

type RespondToDashboard struct {
	DashboardTemplates  *template.Template
	LoadBalancer        *loadbalancer.LoadBalancer
	ServerEventsChannel chan<- goroutine.ResultMessage
}

func NewRespondToDashboard

func NewRespondToDashboard(
	loadBalancer *loadbalancer.LoadBalancer,
	serverEventsChannel chan<- goroutine.ResultMessage,
) (*RespondToDashboard, error)

func (*RespondToDashboard) ServeHTTP

func (self *RespondToDashboard) ServeHTTP(response http.ResponseWriter, request *http.Request)

type RespondToDashboardTemplateProps

type RespondToDashboardTemplateProps struct {
	LlamaCppTargets    <-chan *loadbalancer.LlamaCppTarget
	LoadBalancerStatus *loadbalancer.LoadBalancerStatus
}

type RespondToHealth

type RespondToHealth struct {
	LoadBalancer        *loadbalancer.LoadBalancer
	ServerEventsChannel chan<- goroutine.ResultMessage
}

func (*RespondToHealth) ServeHTTP

func (self *RespondToHealth) ServeHTTP(response http.ResponseWriter, request *http.Request)

type RespondToRegisterTarget

type RespondToRegisterTarget struct {
	LoadBalancer        *loadbalancer.LoadBalancer
	ServerEventsChannel chan<- goroutine.ResultMessage
}

func (*RespondToRegisterTarget) ServeHTTP

func (self *RespondToRegisterTarget) ServeHTTP(response http.ResponseWriter, request *http.Request)

type Server

type Server struct {
	ManagementServerConfiguration *ManagementServerConfiguration
	Logger                        hclog.Logger
	RespondToDashboard            http.Handler
	RespondToHealth               http.Handler
	RespondToRegisterTarget       http.Handler
	RespondToStatic               http.Handler
}

func (*Server) Serve

func (self *Server) Serve(serverEventsChannel chan<- goroutine.ResultMessage)

Jump to

Keyboard shortcuts

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