server

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server provides HTTP server and API handlers for program-director.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port           int
	MetricsEnabled bool
}

Config holds server configuration

type Server

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

Server represents the HTTP server

func NewServer

func NewServer(
	cfg *config.Config,
	serverCfg *Config,
	mediaRepo *repository.MediaRepository,
	historyRepo *repository.HistoryRepository,
	cooldownRepo *repository.CooldownRepository,
	syncService *media.SyncService,
	playlistGenerator *playlist.Generator,
	cooldownManager *cooldown.Manager,
	logger *slog.Logger,
) *Server

NewServer creates a new HTTP server instance

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context) error

Shutdown gracefully shuts down the HTTP server

func (*Server) Start

func (s *Server) Start(ctx context.Context, port int) error

Start starts the HTTP server

Jump to

Keyboard shortcuts

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