shutdown

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package shutdown can be used to execute stuff, when the app is going to exit (exit code x or SigTerm)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exit

func Exit(exitCode int)

Exit Use this function to do a clean exit. Only here the functions will be executed. Not on os.Exit

func ExitOnPanic

func ExitOnPanic()

ExitOnPanic This function can be called, when panic is caught. Call then this to exit gracefully.

Types

type Observer

type Observer interface {
	AddCommand(fn ObserverFunc)
}

Observer Interface of the singleton. Adds a function.

func GetObserver

func GetObserver() Observer

GetObserver Gets the singleton instance. Creates one on first call.

type ObserverFunc

type ObserverFunc func() error

ObserverFunc Function signature for the function to execute

Jump to

Keyboard shortcuts

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