| 1 | // Copyright 2015 Daniel Theophanes. |
| 2 | // Use of this source code is governed by a zlib-style |
| 3 | // license that can be found in the LICENSE file.package service |
| 4 | |
| 5 | // Minimal non-invasive windows only service stub. |
| 6 | // |
| 7 | // Import to allow running as a windows service. |
| 8 | // import _ "github.com/kardianos/minwinsvc" |
| 9 | // This will detect if running as a windows service |
| 10 | // and install required callbacks for windows. |
| 11 | package minwinsvc |
| 12 | |
| 13 | // SetOnExit sets the function to be called when the windows service |
| 14 | // requests an exit. If this is not called, or if it is called where |
| 15 | // f == nil, then it defaults to calling "os.Exit(0)". |
| 16 | func SetOnExit(f func()) { |
| 17 | setOnExit(f) |
| 18 | } |