shutdown

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback added in v0.10.0

type Callback func(ctx context.Context, state State) error

Callback is the callback that must be supplied for registering to receive shutdown notifications

type Manager

type Manager interface {
	Run(context.Context)
	Shutdown(context.Context)
	Register(string, Callback)
}

func NewManager added in v0.7.0

func NewManager(
	log *log.PrefixLogger,
	systemdClient *client.Systemd,
	reader fileio.Reader,
	timeout time.Duration,
	cancelFn context.CancelFunc) Manager

NewManager creates a new shutdown manager.

type State added in v0.10.0

type State struct {
	// SystemShutdown indicates whether the shutdown was triggered by a system shutdown or some other mechanism.
	SystemShutdown bool
}

State indicates the context behind a shutdown

Jump to

Keyboard shortcuts

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