Documentation
¶
Overview ¶
Package TSR provides the API to make the program run in the background, what used to be called "Terminate and Stay Resident" back in the days.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPID = errors.New("PID unknown") ErrNotRunning = errors.New("not running") )
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Print(v ...interface{})
Printf(format string, v ...interface{})
Println(v ...interface{})
}
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func New ¶
New returns new Process. If caller does not set the PID file path and name explicitely with WithPIDFile option, it is inferred from the executable file name. So that the PID file for "foo.exe" will be "foo.pid".
func (*Process) AtExit ¶
func (p *Process) AtExit(fn func())
AtExit appends the function to the list of functions that will be executed when the TSR process terminates. It should be called before TSR() is called.
Click to show internal directories.
Click to hide internal directories.