osservice

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OsServicer

type OsServicer interface {
	Start() error
	Stop() error
	Install() error
	Uninstall() error
	Status() (byte, error)
	Run() error
	Control(action ServiceAction) error
}

func NewOsService

func NewOsService(opts ...ServiceOption) OsServicer

type ServiceAction

type ServiceAction uint16
const (
	ActionRun ServiceAction = 1 << iota
	ActionStart
	ActionStop
	ActionInstall
	ActionUninstall
	ActionStatus
	ActionRestart
)

type ServiceFunc

type ServiceFunc func(ctx context.Context) error

type ServiceOption

type ServiceOption func(opts *internal.ServiceOptions) error

func WithDescription

func WithDescription(Description string) ServiceOption

func WithDisplayName

func WithDisplayName(DisplayName string) ServiceOption

func WithName

func WithName(name string) ServiceOption

func WithRestartFunc

func WithRestartFunc(f func(ctx context.Context) error) ServiceOption

func WithStartFunc

func WithStartFunc(f func(ctx context.Context) error) ServiceOption

func WithStopFunc

func WithStopFunc(f func(ctx context.Context) error) ServiceOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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