* 实现周期采集、快照缓存、本地 HTTP API 和主动上报 * 补齐 Linux 和 Windows 主机、网络、资源、进程和 TCP 采集 * 添加服务生命周期管理、配置加载、构建脚本和测试覆盖 BREAKING CHANGE: network.ips 拆分为 network.ipv4s 和 network.ipv6s。
27 lines
967 B
Go
27 lines
967 B
Go
package service
|
|
|
|
import "mfd-monitor-agent/internal/config"
|
|
|
|
// InstallOptions carries platform-specific service installation inputs.
|
|
type InstallOptions struct {
|
|
// ConfigPath is preserved in the service command line when a config file was supplied.
|
|
ConfigPath string
|
|
}
|
|
|
|
// Manager controls operating system service installation and lifecycle commands.
|
|
type Manager interface {
|
|
// Install registers the agent executable as an operating system service.
|
|
Install(executable string, cfg config.Config, opts InstallOptions) error
|
|
// Uninstall removes the operating system service registration.
|
|
Uninstall(cfg config.Config) error
|
|
// Start asks the operating system service manager to start the agent service.
|
|
Start(cfg config.Config) error
|
|
// Stop asks the operating system service manager to stop the agent service.
|
|
Stop(cfg config.Config) error
|
|
}
|
|
|
|
// NewManager returns the platform-specific service manager.
|
|
func NewManager() Manager {
|
|
return newManager()
|
|
}
|