servicehandler

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Name string
}

func NewConfiguration

func NewConfiguration(unitName string) Configuration

type Handler

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

func NewHandler

func NewHandler(manager UnitManager, configuration Configuration, ctx *log.Context) Handler

func (*Handler) DaemonReload

func (handler *Handler) DaemonReload() error

func (*Handler) DeRegister

func (handler *Handler) DeRegister(ctx *log.Context) error

func (*Handler) Disable

func (handler *Handler) Disable() error

func (*Handler) Enable

func (handler *Handler) Enable() error

func (*Handler) GetInstalledVersion

func (handler *Handler) GetInstalledVersion(ctx *log.Context) (string, error)

func (*Handler) IsActive

func (handler *Handler) IsActive() (bool, error)

func (*Handler) IsEnabled

func (handler *Handler) IsEnabled() (bool, error)

func (*Handler) IsInstalled

func (handler *Handler) IsInstalled() (bool, error)

func (*Handler) Register

func (handler *Handler) Register(ctx *log.Context, unitConfigContent string) error

func (*Handler) Start

func (handler *Handler) Start() error

func (*Handler) Stop

func (handler *Handler) Stop() error

type UnitManager

type UnitManager interface {
	StartUnit(unitName string, ctx *log.Context) error
	StopUnit(unitName string, ctx *log.Context) error
	EnableUnit(unitName string, ctx *log.Context) error
	DisableUnit(unitName string, ctx *log.Context) error
	DaemonReload(unitName string, ctx *log.Context) error
	IsUnitActive(unitName string, ctx *log.Context) error
	IsUnitEnabled(unitName string, ctx *log.Context) (bool, error)
	IsUnitInstalled(unitName string, ctx *log.Context) (bool, error)
	RemoveUnitConfigurationFile(unitName string, ctx *log.Context) error
	CreateUnitConfigurationFile(unitName string, content []byte, ctx *log.Context) error
	GetInstalledVersion(unitName string, ctx *log.Context) (string, error)
}

Jump to

Keyboard shortcuts

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