helper

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package helper provides utility functions for graceful shutdown management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShutdownListener added in v0.1.22

type ShutdownListener struct {
	Shutdowners []Shutdowner
}

ShutdownListener manages multiple shutdowner instances and coordinates their shutdown.

func NewShutdownListener added in v0.1.22

func NewShutdownListener() *ShutdownListener

NewShutdownListener creates a new ShutdownListener instance.

func (*ShutdownListener) Register added in v0.1.22

func (s *ShutdownListener) Register(shutdowner Shutdowner)

Register adds a shutdowner to the list of components to be shut down.

func (*ShutdownListener) RegisterFunc added in v0.1.22

func (s *ShutdownListener) RegisterFunc(shutdownFunc func(ctx context.Context) error)

RegisterFunc adds a shutdown function to the list of components to be shut down.

func (*ShutdownListener) Shutdown added in v0.1.22

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

Shutdown calls shutdown on all registered shutdowners and returns any errors that occurred.

type Shutdowner added in v0.1.22

type Shutdowner interface {
	Shutdown(ctx context.Context) error
}

Shutdowner is an interface for components that need to be shut down gracefully.

Jump to

Keyboard shortcuts

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