svc

package
v0.0.0-...-c4ef65f Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	PathRegKey       = "Path"
	HWND_BROADCAST   = uintptr(0xffff)
	WM_SETTINGCHANGE = uintptr(0x001A)
)

consts to broadcast an environment variable change

Variables

View Source
var ErrNotWindowsService = errors.New("process not started as Windows service")

ErrNotWindowsService indicates the process was not started as a windows service

Functions

This section is empty.

Types

type Service

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

Service implements svc.Service

func (*Service) Context

func (s *Service) Context() context.Context

Context implements svc.Context

func (*Service) Init

func (s *Service) Init(env svc.Environment) error

Init implements svc.Service

func (*Service) Start

func (s *Service) Start() error

Start implements svc.Service

func (*Service) Stop

func (s *Service) Stop() error

Stop implements svc.Service

type ServiceConfig

type ServiceConfig struct {
	InstallPath      string
	ExecName         string
	Args             []string
	LogDirName       string
	Name             string
	DisplayName      string
	Description      string
	DelayedAutoStart bool
	AutoRecovery     bool
	AddToPath        bool
}

ServiceConfig holds information to create a Windows service

func (*ServiceConfig) Install

func (s *ServiceConfig) Install(start bool) error

Install installs the service executable, creates the Windows service, and starts it

func (*ServiceConfig) Service

func (s *ServiceConfig) Service(logger zerolog.Logger, main func() error, stop func() error) *Service

Service returns a new Service for use with svc.Run

func (*ServiceConfig) Uninstall

func (s *ServiceConfig) Uninstall() error

Uninstall uninstalls the service

Jump to

Keyboard shortcuts

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