Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GracefulShutdown ¶
type GracefulShutdown struct {
// contains filtered or unexported fields
}
GracefulShutdown handles the graceful shutdown of application components. It's designed to be reusable across different services. Deprecated: Use ServerManager instead for better coordination.
func NewGracefulShutdown ¶
func NewGracefulShutdown( app *fiber.App, grpcServer *grpc.Server, licenseClient *license.ManagerShutdown, telemetry *opentelemetry.Telemetry, logger log.Logger, ) *GracefulShutdown
NewGracefulShutdown creates a new instance of GracefulShutdown. Deprecated: Use NewServerManager instead for better coordination.
func (*GracefulShutdown) HandleShutdown ¶
func (gs *GracefulShutdown) HandleShutdown()
HandleShutdown sets up signal handling and executes the shutdown sequence when a termination signal is received. Deprecated: Use ServerManager.StartWithGracefulShutdown() instead.
type ServerManager ¶
type ServerManager struct {
// contains filtered or unexported fields
}
ServerManager handles the graceful shutdown of multiple server types. It can manage HTTP servers, gRPC servers, or both simultaneously.
func NewServerManager ¶
func NewServerManager( licenseClient *license.ManagerShutdown, telemetry *opentelemetry.Telemetry, logger log.Logger, ) *ServerManager
NewServerManager creates a new instance of ServerManager.
func (*ServerManager) StartWithGracefulShutdown ¶
func (sm *ServerManager) StartWithGracefulShutdown()
StartWithGracefulShutdown initializes all configured servers and sets up graceful shutdown.
func (*ServerManager) WithGRPCServer ¶
func (sm *ServerManager) WithGRPCServer(server *grpc.Server, address string) *ServerManager
WithGRPCServer configures the gRPC server for the ServerManager.
func (*ServerManager) WithHTTPServer ¶
func (sm *ServerManager) WithHTTPServer(app *fiber.App, address string) *ServerManager
WithHTTPServer configures the HTTP server for the ServerManager.