license

package
v2.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHandler

func DefaultHandler(reason string)

DefaultHandler is the default termination behavior It triggers a panic which will be caught by the graceful shutdown handler

Types

type Handler

type Handler func(reason string)

Handler defines the function signature for termination handlers

type ManagerShutdown

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

ManagerShutdown handles termination behavior

func New

func New() *ManagerShutdown

New creates a new termination manager with the default handler

func (*ManagerShutdown) SetHandler

func (m *ManagerShutdown) SetHandler(handler Handler)

SetHandler updates the termination handler This should be called during application startup, before any validation occurs

func (*ManagerShutdown) Terminate

func (m *ManagerShutdown) Terminate(reason string)

Terminate invokes the termination handler This will trigger the application to gracefully shut down

Jump to

Keyboard shortcuts

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