gopsutil.v2: gopkg.in/shirou/gopsutil.v2/winservices Index | Files

package winservices

import "gopkg.in/shirou/gopsutil.v2/winservices"

Index

Package Files

manager.go winservices.go

type Service Uses

type Service struct {
    Name   string
    Config mgr.Config
    Status ServiceStatus
    // contains filtered or unexported fields
}

Service represent a windows service.

func ListServices Uses

func ListServices() ([]Service, error)

ListServices return all windows service reference to golang.org/x/sys/windows/svc/mgr#ListServices()

func NewService Uses

func NewService(name string) (*Service, error)

NewService create and return a windows Service

func (*Service) GetServiceDetail Uses

func (s *Service) GetServiceDetail() error

GetServiceDetail get a windows service by name

func (*Service) GetServiceDetailWithContext Uses

func (s *Service) GetServiceDetailWithContext(ctx context.Context) error

GetServiceDetailWithContext get a windows service by name

func (*Service) QueryServiceConfig Uses

func (s *Service) QueryServiceConfig() (mgr.Config, error)

QueryServiceConfig return the specified service config

func (*Service) QueryServiceConfigWithContext Uses

func (s *Service) QueryServiceConfigWithContext(ctx context.Context) (mgr.Config, error)

QueryServiceConfigWithContext call QueryServiceConfig() and QueryServiceConfig2() implement windows https://msdn.microsoft.com/en-us/library/windows/desktop/ms684932(v=vs.85).aspx

func (*Service) QueryStatus Uses

func (s *Service) QueryStatus() (ServiceStatus, error)

QueryStatus return the specified name service currentState and ControlsAccepted

func (*Service) QueryStatusWithContext Uses

func (s *Service) QueryStatusWithContext(ctx context.Context) (ServiceStatus, error)

QueryStatusWithContext return the specified name service currentState and ControlsAccepted

type ServiceStatus Uses

type ServiceStatus struct {
    State         svc.State
    Accepts       svc.Accepted
    Pid           uint32
    Win32ExitCode uint32
}

ServiceStatus combines State and Accepted commands to fully describe running service.

Package winservices imports 5 packages (graph). Updated 2020-11-24 with GOOS=windows. Refresh now. Tools for package owners.