rclone: github.com/ncw/rclone/lib/atexit Index | Files

package atexit

import "github.com/ncw/rclone/lib/atexit"

Package atexit provides handling for functions you want called when the program exits unexpectedly due to a signal.

You should also make sure you call Run in the normal exit path.

Index

Package Files

atexit.go atexit_unix.go

func IgnoreSignals Uses

func IgnoreSignals()

IgnoreSignals disables the signal handler and prevents Run from beeing executed automatically

func Run Uses

func Run()

Run all the at exit functions if they haven't been run already

func Unregister Uses

func Unregister(handle FnHandle)

Unregister a function using the handle returned by `Register`

type FnHandle Uses

type FnHandle *func()

FnHandle is the type of the handle returned by function `Register` that can be used to unregister an at-exit function

func Register Uses

func Register(fn func()) FnHandle

Register a function to be called on exit. Returns a handle which can be used to unregister the function with `Unregister`.

Package atexit imports 5 packages (graph) and is imported by 9 packages. Updated 2019-08-18. Refresh now. Tools for package owners.