lifecycle

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shutdown

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

func NewShutdown

func NewShutdown() *Shutdown

func (*Shutdown) BeginShutdown

func (s *Shutdown) BeginShutdown()

BeginShutdown implements core.ShutdownCoordinator

func (*Shutdown) Context

func (s *Shutdown) Context() context.Context

Context returns the global shutdown context.

func (*Shutdown) Done

func (s *Shutdown) Done() <-chan struct{}

Done implements core.ShutdownCoordinator

func (*Shutdown) Initiate

func (s *Shutdown) Initiate(
	source core.CancellationSource,
	timeout time.Duration,
)

func (*Shutdown) IsShuttingDown

func (s *Shutdown) IsShuttingDown() bool

IsShuttingDown reports whether shutdown has started.

func (*Shutdown) Reason

func (s *Shutdown) Reason() core.CancellationSource

Reason returns the shutdown reason. If shutdown has not started, SourceUnknown is returned.

func (*Shutdown) RegisterHook

func (s *Shutdown) RegisterHook(h ShutdownHook)

RegisterHook registers a shutdown hook.

Panics if hook is nil. Registration order defines shutdown order (LIFO).

type ShutdownHook

type ShutdownHook func(ctx context.Context)

Jump to

Keyboard shortcuts

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