server

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 26, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	Cache         *sql.DB
	CacheDuration int
	Interface     string
	Config        *config.Config
	EventLogger   *logger.Logger
	LLMConfig     llm.Config
	Logger        *logrus.Logger
	Model         llms.Model
	Servers       map[uint16]*http.Server
}

Server holds the configuration and components for running HTTP/TLS servers.

func (*Server) ListenForShutdownSignals

func (s *Server) ListenForShutdownSignals()

ListenForShutdownSignals handles graceful shutdown on receiving signals.

func (*Server) SetupServer

func (s *Server) SetupServer(pc config.PortConfig) *http.Server

SetupServer configures the server with the provided settings.

func (*Server) StartHTTPServer

func (s *Server) StartHTTPServer(server *http.Server, pc config.PortConfig) error

StartHTTPServer starts the configured HTTP server.

func (*Server) StartServers

func (s *Server) StartServers() error

StartServers starts all servers defined in the configuration.

func (*Server) StartTLSServer

func (s *Server) StartTLSServer(server *http.Server, pc config.PortConfig) error

StartTLSServer starts the configured TLS server.

Jump to

Keyboard shortcuts

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