ws

package module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2024 License: MIT Imports: 8 Imported by: 0

README

ws

Windows Service

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectToService added in v1.3.0

func ConnectToService(name string) (*mgr.Service, error)

func Continue added in v1.3.0

func Continue(name string, waitTime time.Duration) error

func InstallService added in v1.3.0

func InstallService(name string, exepath string, cfg mgr.Config, options ...Option) error

func Pause added in v1.3.0

func Pause(name string, waitTime time.Duration) error

func RemoveService added in v1.3.0

func RemoveService(name string) error

func SendCommand added in v1.3.0

func SendCommand(name string, c svc.Cmd, to svc.State, waitTime time.Duration) error

func Start added in v1.3.0

func Start(name string, waitTime time.Duration, args ...string) error

func Stop added in v1.3.0

func Stop(name string, waitTime time.Duration) error

func WaitForState added in v1.3.0

func WaitForState(s *mgr.Service, to svc.State, waitTime time.Duration) error

Types

type ChangeHandlerFunc

type ChangeHandlerFunc func(s *Service, c svc.ChangeRequest)

type HandlerFunc added in v1.3.0

type HandlerFunc func(s *Service, args ...string)

type Option added in v1.3.0

type Option struct {
	// contains filtered or unexported fields
}

func ArgsOption added in v1.3.0

func ArgsOption(args ...string) Option

func DelayedAutostartOption added in v1.3.0

func DelayedAutostartOption() Option

func FailureActionsOption added in v1.3.0

func FailureActionsOption(failureActions windows.SERVICE_FAILURE_ACTIONS) Option

func PreShutdownOption added in v1.3.0

func PreShutdownOption(d time.Duration) Option

type Service

type Service struct {
	// contains filtered or unexported fields
}

func ServiceHandler added in v1.3.0

func ServiceHandler(name string, handlerFunc HandlerFunc) *Service

func (*Service) Execute added in v1.3.0

func (s *Service) Execute(args []string, r <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32)

func (*Service) RegisterChangeHandler added in v1.3.0

func (s *Service) RegisterChangeHandler(cmd svc.Cmd, f ChangeHandlerFunc)

func (*Service) Run added in v1.3.0

func (s *Service) Run(args ...string) error

func (*Service) SendAccepts added in v1.3.0

func (s *Service) SendAccepts(accepts svc.Accepted)

func (*Service) SendState added in v1.3.0

func (s *Service) SendState(state svc.State)

func (*Service) SendStatus added in v1.3.0

func (s *Service) SendStatus(status svc.Status)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL