💥 feat(agent)!: 添加主机监控代理首版

* 实现周期采集、快照缓存、本地 HTTP API 和主动上报

* 补齐 Linux 和 Windows 主机、网络、资源、进程和 TCP 采集

* 添加服务生命周期管理、配置加载、构建脚本和测试覆盖

BREAKING CHANGE: network.ips 拆分为 network.ipv4s 和 network.ipv6s。
This commit is contained in:
codex
2026-05-18 15:25:51 +00:00
commit 89d5e27874
33 changed files with 4205 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
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()
}