Help us shape the future of Go! Take the 2026 Go Developer Survey

runtime

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 5 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 {
	Timeout time.Duration
	// contains filtered or unexported fields
}

func New

func New(timeout time.Duration) *Shutdown

func (*Shutdown) Add

func (s *Shutdown) Add(fn func(context.Context) error)

func (*Shutdown) Wait

func (s *Shutdown) Wait(ctx context.Context) error

Wait blocks until SIGINT/SIGTERM is received, then runs hooks in reverse order. Returns the first error encountered (but still attempts all hooks).

Jump to

Keyboard shortcuts

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