Documentation
¶
Index ¶
- type ErrorFunc
- type ErrorHandler
- type GSInterface
- type GracefulShutdown
- func (gs *GracefulShutdown) AddShutdownCallback(shutdownCallback ShutdownCallback)
- func (gs *GracefulShutdown) AddShutdownManager(manager ShutdownManager)
- func (gs *GracefulShutdown) ReportError(err error)
- func (gs *GracefulShutdown) SetErrorHandler(handler ErrorHandler)
- func (gs *GracefulShutdown) Start() error
- func (gs *GracefulShutdown) StartShutdown(sm ShutdownManager)
- type ShutdownCallback
- type ShutdownFunc
- type ShutdownManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 ShutdownFunc ¶
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
}
Click to show internal directories.
Click to hide internal directories.