srv

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2025 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(handler http.Handler, config ServerConfig) *server

NewServer creates a new server instance with the given handler and configuration.

Types

type CleanupHandler

type CleanupHandler interface {
	Shutdown(ctx context.Context) error
}

CleanupHandler is an interface that allows components (e.g., DB, workers) to hook into the server shutdown and clean up resources gracefully.

type ServerConfig

type ServerConfig struct {
	TLSCertPath string // Path to the TLS certificate file
	TLSKeyPath  string // Path to the TLS key file
	Port        int    // Port to bind the HTTP server to
	TLSEnabled  bool   // Enable TLS if true
}

ServerConfig defines configuration for launching the HTTP server.

Jump to

Keyboard shortcuts

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