Discover Packages
github.com/quantonganh/gitea
modules
minwinsvc
package
Version:
v1.3.0-rc1
Opens a new window with list of versions in this module.
Published: Nov 15, 2017
License: MIT, Zlib
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Minimal windows service stub
Programs designed to run from most *nix style operating systems
can import this package to enable running programs as services without modifying
them.
import _ "github.com/kardianos/minwinsvc"
If you need more control over the exit behavior, set
minwinsvc.SetOnExit(func() {
// Do something.
// Within 10 seconds call:
os.Exit(0)
})
Expand ▾
Collapse ▴
Documentation
¶
Rendered for
linux/amd64
windows/amd64
darwin/amd64
js/wasm
Package minwinsvc is a minimal non-invasive windows only service stub.
Import to allow running as a windows service.
import _ "github.com/kardianos/minwinsvc"
This will detect if running as a windows service
and install required callbacks for windows.
SetOnExit sets the function to be called when the windows service
requests an exit. If this is not called, or if it is called where
f == nil, then it defaults to calling "os.Exit(0)".
Source Files
¶
Click to show internal directories.
Click to hide internal directories.