httpserver

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port          int
	TLSCert       string
	TLSKey        string
	HostKeyPath   string
	SSHPort       int
	Logger        *slog.Logger
	Extenders     []MuxExtender
	ExtraHandlers map[string]http.Handler
}

Config holds HTTP server configuration.

type MuxExtender

type MuxExtender interface {
	RegisterHTTPHandlers(mux *http.ServeMux)
}

MuxExtender can register additional handlers on the HTTP mux.

type Server

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

Server is the HTTP front page server.

func New

func New(fsys fs.FS, cfg Config) *Server

New creates a new HTTP server serving the given filesystem.

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()

Start starts the HTTP server in a goroutine.

Jump to

Keyboard shortcuts

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