servicemanagers

package
v0.0.0-...-d707f67 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package servicemanagers contains functions related to service manager

Package servicemanagers contains functions related to service manager

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartAgent

func StartAgent(manager IServiceManager, log log.T) error

StartAgent attempts to start the agent and verifies it is running using retries

func StopAgent

func StopAgent(manager IServiceManager, log log.T) error

StopAgent attempts to stop the agent and verifies it is stopped using retries

Types

type IServiceManager

type IServiceManager interface {
	// StartAgent starts the agent
	StartAgent() error
	// StopAgent stops the agent
	StopAgent() error
	// GetAgentStatus returns the status of the agent from the perspective of the service manager
	GetAgentStatus() (common.AgentStatus, error)
	// ReloadManager reloads the service manager configuration files
	ReloadManager() error
	// IsManagerEnvironment returns true if all commands required by the package manager are available
	IsManagerEnvironment() bool
	// GetName returns the service manager name
	GetName() string
	// GetType returns the service manage type
	GetType() ServiceManager
}

func GetServiceManager

func GetServiceManager(managerType ServiceManager) (IServiceManager, bool)

GetServiceManager returns the service manager instance for a specific service manager type

type ServiceManager

type ServiceManager int
const (
	Undefined ServiceManager = iota
	Snap
	SystemCtl
	Upstart
	LaunchCtl
	Windows
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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