shutdown

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorFunc

type ErrorFunc func(err error)

func (ErrorFunc) HandleError

func (e ErrorFunc) HandleError(err error)

type ErrorHandler

type ErrorHandler interface {
	HandleError(err error)
}

type GSInterface

type GSInterface interface {
	StartShutdown(sm ShutdownManager)
	ReportError(err error)
	AddShutdownCallback(shutdownCallback ShutdownCallback)
}

type GracefulShutdown

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

func New

func New() *GracefulShutdown

func (*GracefulShutdown) AddShutdownCallback

func (gs *GracefulShutdown) AddShutdownCallback(shutdownCallback ShutdownCallback)

func (*GracefulShutdown) AddShutdownManager

func (gs *GracefulShutdown) AddShutdownManager(manager ShutdownManager)

func (*GracefulShutdown) ReportError

func (gs *GracefulShutdown) ReportError(err error)

func (*GracefulShutdown) SetErrorHandler

func (gs *GracefulShutdown) SetErrorHandler(handler ErrorHandler)

func (*GracefulShutdown) Start

func (gs *GracefulShutdown) Start() error

func (*GracefulShutdown) StartShutdown

func (gs *GracefulShutdown) StartShutdown(sm ShutdownManager)

type ShutdownCallback

type ShutdownCallback interface {
	OnShutdown(managerName string) error
}

type ShutdownFunc

type ShutdownFunc func(string) error

func (ShutdownFunc) OnShutdown

func (f ShutdownFunc) OnShutdown(shutdownManager string) error

type ShutdownManager

type ShutdownManager interface {
	GetName() string
	Start(gs GSInterface) error
	ShutdownStart() error
	ShutdownFinished() error
}

Directories

Path Synopsis
shutdownmanager

Jump to

Keyboard shortcuts

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