server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package server provides HTTP server setup and lifecycle management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMux

func NewMux(params RouteParams) *http.ServeMux

NewMux creates the main HTTP ServeMux with all routes configured

func NewServer

func NewServer(mux *http.ServeMux, config config.ServerConfig) *http.Server

NewServer creates the main HTTP server instance

func RegisterHooks

func RegisterHooks(lc fx.Lifecycle, server *http.Server, logger log.Logger)

RegisterHooks registers the OnStart and OnStop hooks for the HTTP server

Types

type RouteParams

type RouteParams struct {
	UIHandler  http.Handler
	APIHandler http.Handler
}

RouteParams defines the handlers needed to set up routes

Jump to

Keyboard shortcuts

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