server

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 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 ConfigReloadFunc

type ConfigReloadFunc func() error

ConfigReloadFunc is a function that reloads configuration

type GracefulServer

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

GracefulServer wraps an HTTP server with graceful shutdown capabilities

func NewGracefulServer

func NewGracefulServer(addr string, handler http.Handler) *GracefulServer

NewGracefulServer creates a new graceful HTTP server

func (*GracefulServer) IsShuttingDown

func (gs *GracefulServer) IsShuttingDown() bool

IsShuttingDown returns true if shutdown has been initiated

func (*GracefulServer) ReloadConfig

func (gs *GracefulServer) ReloadConfig() error

ReloadConfig triggers a configuration reload

func (*GracefulServer) SetConfigReloadFunc

func (gs *GracefulServer) SetConfigReloadFunc(fn ConfigReloadFunc)

SetConfigReloadFunc sets the function to call when configuration reload is triggered

func (*GracefulServer) Shutdown

func (gs *GracefulServer) Shutdown(timeout time.Duration) error

Shutdown initiates a graceful shutdown

func (*GracefulServer) ShutdownChannel

func (gs *GracefulServer) ShutdownChannel() <-chan struct{}

ShutdownChannel returns a channel that closes when shutdown is initiated

func (*GracefulServer) Start

func (gs *GracefulServer) Start() error

Start starts the server and handles graceful shutdown signals

Jump to

Keyboard shortcuts

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