Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddListener ¶
func AddListener(listener ShutdownListener)
AddListener is used to append the input ShutdownListener to the internal list which will be used for notification.
Types ¶
type ShutdownHandler ¶
type ShutdownHandler struct {
// contains filtered or unexported fields
}
ShutdownHandler is responsible for listening to shutdown notifications and propagate the same
func GetShutdownHandler ¶
func GetShutdownHandler() *ShutdownHandler
GetShutdownHandler can be invoked from other packages for fetching an instance of the ShutdownHandler
func (*ShutdownHandler) Init ¶
func (shutdownHandler *ShutdownHandler) Init(logger *glog.Logger)
Init initializes the ShutdownHandler Don't set logger if you want to log to the terminal - shutdown.GetShutdownHandler().Init(nil)
type ShutdownListener ¶
type ShutdownListener interface {
HandleShutdown()
}
ShutdownListener should be implemented by structs which needs shutdown notification
Click to show internal directories.
Click to hide internal directories.