Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHandler ¶ added in v1.14.0
func DefaultHandler(reason string)
DefaultHandler panics with a descriptive message This will be caught by the recover() in the application's graceful shutdown handler
func StartServerWithGracefulShutdown ¶
func StartServerWithGracefulShutdown( app *fiber.App, licenseClient *LicenseManagerShutdown, telemetry *opentelemetry.Telemetry, serverAddress string, logger log.Logger, )
StartServerWithGracefulShutdown starts the Fiber server in a goroutine and sets up graceful shutdown handling.
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.
func NewGracefulShutdown ¶
func NewGracefulShutdown( app *fiber.App, licenseClient *LicenseManagerShutdown, telemetry *opentelemetry.Telemetry, logger log.Logger, ) *GracefulShutdown
NewGracefulShutdown creates a new instance of GracefulShutdown.
func (*GracefulShutdown) HandleShutdown ¶
func (gs *GracefulShutdown) HandleShutdown()
HandleShutdown sets up signal handling and executes the shutdown sequence when a termination signal is received.
type Handler ¶ added in v1.14.0
type Handler func(reason string)
Handler defines a function that handles license validation termination
type LicenseManagerShutdown ¶ added in v1.14.0
type LicenseManagerShutdown struct {
// contains filtered or unexported fields
}
LicenseManagerShutdown handles termination behavior
func New ¶ added in v1.14.0
func New() *LicenseManagerShutdown
New creates a new termination manager with the default handler
func (*LicenseManagerShutdown) SetHandler ¶ added in v1.14.0
func (m *LicenseManagerShutdown) SetHandler(handler Handler)
SetHandler updates the termination handler This should be called during application startup, before any validation occurs
func (*LicenseManagerShutdown) Terminate ¶ added in v1.14.0
func (m *LicenseManagerShutdown) Terminate(reason string)
Terminate invokes the termination handler This will trigger the application to gracefully shut down