httpserver

package
v0.0.0-...-df8f258 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package httpserver provides the HTTP/API server for RotomNG.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address        string
	Listener       net.Listener
	UIPath         string
	UIFS           *embed.FS
	DevMode        bool
	MetricsHandler MetricsHandler
	AuthMiddleware services.AuthMiddleware
	APIHandler     HTTPAPIHandler
	StatsRegistrar services.StatsRegistrar
}

Config holds configuration for the HTTP server.

type HTTPAPIHandler

type HTTPAPIHandler interface {
	SetupAPIRoutes(apiGroup *gin.RouterGroup)
	GetPrometheusEnabled() bool
	GetConfig(ginContext *gin.Context)
	ConfigReload(ginContext *gin.Context)
}

HTTPAPIHandler defines the interface for API route handlers.

type HTTPServer

type HTTPServer = services.WebServer

HTTPServer is a type alias for the generic web server.

func NewHTTPServer

func NewHTTPServer(ctx context.Context, logger *slog.Logger, cfg Config) (*HTTPServer, error)

NewHTTPServer creates a new HTTPServer instance with app-specific route setup.

type MetricsHandler

type MetricsHandler interface {
	GetMetricsHandler() http.Handler
}

MetricsHandler defines the interface for providing a metrics HTTP handler.

Jump to

Keyboard shortcuts

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