Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
HealthCheck is a function that returns an error if the check fails.
type Option ¶
type Option func(*Server)
Option configures the server.
func WithMetrics ¶
WithMetrics attaches a metrics collector.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server provides an HTTP server with health, metrics, and admin endpoints.
func (*Server) ListenAndServe ¶
ListenAndServe starts the HTTP server with graceful shutdown on SIGINT/SIGTERM.
func (*Server) OnShutdown ¶
func (s *Server) OnShutdown(fn func())
OnShutdown registers a function to call during graceful shutdown.
func (*Server) RegisterHealthCheck ¶
func (s *Server) RegisterHealthCheck(name string, check HealthCheck)
RegisterHealthCheck adds a named health check.
Click to show internal directories.
Click to hide internal directories.