Documentation
¶
Overview ¶
Package exitcleanup provides helpers for running cleanups when the program is interrupted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExitCleaner ¶ added in v0.1.3
type ExitCleanup ¶
type ExitCleanup struct {
// contains filtered or unexported fields
}
ExitCleanup supports registering functions to be called when the program is interrupted.
func New ¶
func New(log *log.Logger) (*ExitCleanup, func())
New creates an ExitCleanup. It returns a cleanup function that should be called once right before exiting the app.
func (*ExitCleanup) Register ¶
func (cleanup *ExitCleanup) Register(fn func() error)
Register a callback cleanup function.
Click to show internal directories.
Click to hide internal directories.