Documentation ¶
Overview ¶
Package mgr can be used to manage Windows service programs. It can be used to install and remove them. It can also start, stop, pause and so on. It can query current service state. It can query service config parameters and change them.
Index ¶
- Constants
- type Config
- type Mgr
- type Service
- func (s *Service) Close() error
- func (s *Service) Config() (Config, error)
- func (s *Service) Control(c svc.Cmd) (svc.Status, error)
- func (s *Service) Delete() error
- func (s *Service) Query() (svc.Status, error)
- func (s *Service) Start(args []string) error
- func (s *Service) UpdateConfig(c Config) error
Constants ¶
const ( // Service start types StartManual = winapi.SERVICE_DEMAND_START // the service must be started manually StartAutomatic = winapi.SERVICE_AUTO_START // the service will start by itself whenever the computer reboots StartDisabled = winapi.SERVICE_DISABLED // the service cannot be started // The severity of the error, and action taken, // if this service fails to start. ErrorCritical = winapi.SERVICE_ERROR_CRITICAL ErrorIgnore = winapi.SERVICE_ERROR_IGNORE ErrorNormal = winapi.SERVICE_ERROR_NORMAL ErrorSevere = winapi.SERVICE_ERROR_SEVERE )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mgr ¶
Mgr is used to manage Windows service.
func ConnectRemote ¶
ConnectRemote establishes a connection to the service control manager on computer named host.
func (*Mgr) CreateService ¶
CreateService installs new service name on the system. The service will be executed by running exepath binary, while service settings are specified in config c.
func (*Mgr) Disconnect ¶
Disconnect closes connection m to servise control manager.
type Service ¶
Service is used to access Windows service.
func (*Service) Delete ¶
Delete marks service s for deletion from the service control manager database.