Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ControlAction = [6]string{"start", "stop", "restart", "install", "uninstall", "status"} ControlActionUsage = [6]string{"启动", "停止", "重启", "安装", "卸载", "状态"} ErrUnknownAction = errors.New("无效的控制命令") )
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct { Name string // Required name of the service. No spaces suggested. DisplayName string // Display name, spaces allowed. Description string // Long description of service. UserName string // Run as username. Arguments []string // Run with arguments. // Optional field to specify the executable for service. // If empty the current executable is used. Executable string // Array of service dependencies. // Not yet fully implemented on Linux or OS X: // 1. Support linux-systemd dependencies, just put each full line as the // element of the string array, such as // "After=network.target syslog.target" // "Requires=syslog.target" // Note, such lines will be directly appended into the [Unit] of // the generated service config file, will not check their correctness. Dependencies []string // The following fields are not supported on Windows. WorkingDirectory string // Initial working directory. ChRoot string Option map[string]any // System specific options. EnvVars map[string]string Init func() error //block exec Run func(context.Context) error //non-block exec }
Click to show internal directories.
Click to hide internal directories.