Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Logger = log.Default() // Time to wait for a new process to initialize. When this time has passed // the old process will be killed whether the new processes has finished // initializing or not. StartupTimeout = time.Minute * 10 // Signals which cause the child process to be restarted ReloadSignals = []os.Signal{syscall.SIGHUP} // Signals which cause the server to shut down. The first signal in this // list is used to shut down the child process when it's time to restart StopSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT} // Signals to pass through to the child process PassthroughSignals []os.Signal // Signal the child process sends to the parent process to indicate that // initialization is finished. Make this this is the same on both the parent // and the child StartupFinishedSignal = syscall.SIGUSR1 // Extra file descriptors to pass to the child process ExtraFiles []*os.File // Extra environment variables to pass to the child process ExtraVariables []string )
Functions ¶
func Init ¶
func Init() (exit bool)
Initialize the zerodown parent process. This should be the very first thing your main function calls. If this function returns exit=true then your main function should return.
Correct usage:
func main() { if zerodown.Init() { return } // Initialize your server: Connect to database, listen on a port, etc zerodown.StartupFinished() // Listen for signals and exit when done }
func Restart ¶
func Restart() (err error)
Restart allows a child process to call for a restart. The parent process will start a new child and will shut down the current process
func StartupFinished ¶
func StartupFinished()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.