mirror of
https://github.com/kardianos/service.git
synced 2025-09-27 05:06:13 +08:00
service: go fmt comments
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
||||
var logger service.Logger
|
||||
|
||||
// Program structures.
|
||||
//
|
||||
// Define Start and Stop methods.
|
||||
type program struct {
|
||||
exit chan struct{}
|
||||
@@ -54,6 +55,7 @@ func (p *program) Stop(s service.Service) error {
|
||||
}
|
||||
|
||||
// Service setup.
|
||||
//
|
||||
// Define service config.
|
||||
// Create the service.
|
||||
// Setup the logger.
|
||||
|
38
service.go
38
service.go
@@ -167,41 +167,69 @@ func New(i Interface, c *Config) (Service, error) {
|
||||
}
|
||||
|
||||
// KeyValue provides a list of system specific options.
|
||||
// * OS X
|
||||
//
|
||||
// - OS X
|
||||
//
|
||||
// - LaunchdConfig string () - Use custom launchd config.
|
||||
//
|
||||
// - KeepAlive bool (true) - Prevent the system from stopping the service automatically.
|
||||
//
|
||||
// - RunAtLoad bool (false) - Run the service after its job has been loaded.
|
||||
//
|
||||
// - SessionCreate bool (false) - Create a full user session.
|
||||
//
|
||||
// * Solaris
|
||||
// - Solaris
|
||||
//
|
||||
// - Prefix string ("application") - Service FMRI prefix.
|
||||
//
|
||||
// * POSIX
|
||||
// - POSIX
|
||||
//
|
||||
// - UserService bool (false) - Install as a current user service.
|
||||
//
|
||||
// - SystemdScript string () - Use custom systemd script.
|
||||
//
|
||||
// - UpstartScript string () - Use custom upstart script.
|
||||
//
|
||||
// - SysvScript string () - Use custom sysv script.
|
||||
//
|
||||
// - OpenRCScript string () - Use custom OpenRC script.
|
||||
//
|
||||
// - RunWait func() (wait for SIGNAL) - Do not install signal but wait for this function to return.
|
||||
//
|
||||
// - ReloadSignal string () [USR1, ...] - Signal to send on reload.
|
||||
//
|
||||
// - PIDFile string () [/run/prog.pid] - Location of the PID file.
|
||||
//
|
||||
// - LogOutput bool (false) - Redirect StdErr & StandardOutPath to files.
|
||||
//
|
||||
// - Restart string (always) - How shall service be restarted.
|
||||
//
|
||||
// - SuccessExitStatus string () - The list of exit status that shall be considered as successful,
|
||||
// in addition to the default ones.
|
||||
//
|
||||
// - LogDirectory string(/var/log) - The path to the log files directory
|
||||
//
|
||||
// * Linux (systemd)
|
||||
// - Linux (systemd)
|
||||
//
|
||||
// - LimitNOFILE int (-1) - Maximum open files (ulimit -n)
|
||||
// (https://serverfault.com/questions/628610/increasing-nproc-for-processes-launched-by-systemd-on-centos-7)
|
||||
// * Windows
|
||||
//
|
||||
// - Windows
|
||||
//
|
||||
// - DelayedAutoStart bool (false) - After booting, start this service after some delay.
|
||||
//
|
||||
// - Password string () - Password to use when interfacing with the system service manager.
|
||||
//
|
||||
// - Interactive bool (false) - The service can interact with the desktop. (more information https://docs.microsoft.com/en-us/windows/win32/services/interactive-services)
|
||||
//
|
||||
// - DelayedAutoStart bool (false) - after booting start this service after some delay.
|
||||
//
|
||||
// - StartType string ("automatic") - Start service type. (automatic | manual | disabled)
|
||||
//
|
||||
// - OnFailure string ("restart" ) - Action to perform on service failure. (restart | reboot | noaction)
|
||||
//
|
||||
// - OnFailureDelayDuration string ( "1s" ) - Delay before restarting the service, time.Duration string.
|
||||
//
|
||||
// - OnFailureResetPeriod int ( 10 ) - Reset period for errors, seconds.
|
||||
type KeyValue map[string]interface{}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
//+build aix
|
||||
//go:build aix
|
||||
// +build aix
|
||||
|
||||
// Copyright 2015 Daniel Theophanes.
|
||||
// Use of this source code is governed by a zlib-style
|
||||
|
@@ -1,4 +1,5 @@
|
||||
//+build go1.8
|
||||
//go:build go1.8
|
||||
// +build go1.8
|
||||
|
||||
package service
|
||||
|
||||
|
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a zlib-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build !su
|
||||
// +build !su
|
||||
|
||||
package service_test
|
||||
|
@@ -3,6 +3,7 @@
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// This needs to be run as root/admin hence the reason there is a build tag
|
||||
//go:build su
|
||||
// +build su
|
||||
|
||||
package service_test
|
||||
|
@@ -2,6 +2,7 @@
|
||||
// Use of this source code is governed by a zlib-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:build darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || solaris
|
||||
// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
|
||||
|
||||
package service_test
|
||||
|
Reference in New Issue
Block a user