controller

package
v0.0.0-...-e7f4e31 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckActive

func CheckActive(serviceName string) (bool, error)

func CheckEnable

func CheckEnable(serviceName string) (bool, error)

func CheckExist

func CheckExist(serviceName string) (bool, error)

func GetScriptName

func GetScriptName(keyword string) (string, error)

func GetServicePath

func GetServicePath(serviceName string) (string, error)

GetServicePath returns the configuration file path for the specified service. If serviceName is empty, it returns the default directory path based on the system's service manager. For non-empty serviceName, it retrieves the exact service file path. Parameters:

  • serviceName: Name of the service. If empty, returns the default directory.

Returns:

  • string: The service configuration file path.
  • error: Error if the service manager is unsupported or command execution fails.

func Handle

func Handle(operate, serviceName string) error

func HandleRestart

func HandleRestart(serviceName string) error

func HandleStart

func HandleStart(serviceName string) error

func HandleStop

func HandleStop(serviceName string) error

func LoadServiceName

func LoadServiceName(keyword string) (string, error)

func Reload

func Reload() error

func RestartPanel

func RestartPanel(core, agent, reload bool)

func SelectInitScript

func SelectInitScript(keyword string) (string, error)

Types

type Controller

type Controller interface {
	Name() string
	IsActive(serviceName string) (bool, error)
	IsEnable(serviceName string) (bool, error)
	IsExist(serviceName string) (bool, error)
	Status(serviceName string) (string, error)

	Operate(operate, serviceName string) error

	Reload() error
}

func New

func New() (Controller, error)

func NewWithClient

func NewWithClient(client *ssh.SSHClient) (Controller, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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