Documentation
¶
Index ¶
- func CheckActive(serviceName string) (bool, error)
- func CheckEnable(serviceName string) (bool, error)
- func CheckExist(serviceName string) (bool, error)
- func GetScriptName(keyword string) (string, error)
- func GetServicePath(serviceName string) (string, error)
- func Handle(operate, serviceName string) error
- func HandleRestart(serviceName string) error
- func HandleStart(serviceName string) error
- func HandleStop(serviceName string) error
- func LoadServiceName(keyword string) (string, error)
- func Reload() error
- func RestartPanel(core, agent, reload bool)
- func SelectInitScript(keyword string) (string, error)
- type Controller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckActive ¶
func CheckEnable ¶
func CheckExist ¶
func GetScriptName ¶
func GetServicePath ¶
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 HandleRestart ¶
func HandleStart ¶
func HandleStop ¶
func LoadServiceName ¶
func RestartPanel ¶
func RestartPanel(core, agent, reload bool)
func SelectInitScript ¶
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)
Click to show internal directories.
Click to hide internal directories.