package winservices
import "github.com/shirou/gopsutil/v3/winservices"
Index ¶
- type Service
- func ListServices() ([]Service, error)
- func NewService(name string) (*Service, error)
- func (s *Service) GetServiceDetail() error
- func (s *Service) GetServiceDetailWithContext(ctx context.Context) error
- func (s *Service) QueryServiceConfig() (mgr.Config, error)
- func (s *Service) QueryServiceConfigWithContext(ctx context.Context) (mgr.Config, error)
- func (s *Service) QueryStatus() (ServiceStatus, error)
- func (s *Service) QueryStatusWithContext(ctx context.Context) (ServiceStatus, error)
- type ServiceStatus
Types ¶
type Service ¶
type Service struct { Name string Config mgr.Config Status ServiceStatus // contains filtered or unexported fields }
Service represent a windows service.
func ListServices ¶
ListServices return all windows service reference to golang.org/x/sys/windows/svc/mgr#ListServices()
func NewService ¶
NewService create and return a windows Service
func (*Service) GetServiceDetail ¶
GetServiceDetail get a windows service by name
func (*Service) GetServiceDetailWithContext ¶
GetServiceDetailWithContext get a windows service by name
func (*Service) QueryServiceConfig ¶
QueryServiceConfig return the specified service config
func (*Service) QueryServiceConfigWithContext ¶
QueryServiceConfigWithContext call QueryServiceConfig() and QueryServiceConfig2() implement windows https://msdn.microsoft.com/en-us/library/windows/desktop/ms684932(v=vs.85).aspx
func (*Service) QueryStatus ¶
func (s *Service) QueryStatus() (ServiceStatus, error)
QueryStatus return the specified name service currentState and ControlsAccepted
func (*Service) QueryStatusWithContext ¶
func (s *Service) QueryStatusWithContext(ctx context.Context) (ServiceStatus, error)
QueryStatusWithContext return the specified name service currentState and ControlsAccepted
type ServiceStatus ¶
ServiceStatus combines State and Accepted commands to fully describe running service.
Source Files ¶
- Version
- v3.21.6
- Published
- Jul 1, 2021
- Platform
- windows/amd64
- Imports
- 5 packages
- Last checked
- 4 days ago –
Tools for package owners.