appexit

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2023 License: MIT Imports: 6 Imported by: 0

README

appexit

golang library to call os.Exit() when specified events are triggered.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIfClone

func CheckIfClone(ctx context.Context) (isClone bool, err error)

CheckIfClone checks if a clone of this exe is running

func Clone

func Clone(ctx context.Context) (err error)

Clone exits if a clone of this exe is running

func CloneWithLockFile

func CloneWithLockFile(ctx context.Context, lockPath string) (err error)

CloneWithLockFile exits when a new clone of this exe creates a new lock file at lockPath On startup, new clones create a lock file and then wait for 2 seconds for other clones to exit Once running, the exe checks for a lock file every second and exits if a lock file exists

func PID

func PID(ctx context.Context, cancel context.CancelFunc, killPID *int)

PID exits when process with pid exits

Types

This section is empty.

Jump to

Keyboard shortcuts

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