docs(agent): 统一中文注释并补充部署文档

将代码与测试注释改为中文以符合仓库规范;新增中文部署指南、
示例配置,并完善构建脚本对 VERSION 注入的说明。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
codex
2026-05-19 02:30:49 +00:00
parent 89d5e27874
commit 877e4cf41d
28 changed files with 608 additions and 226 deletions

View File

@@ -7,23 +7,23 @@ import (
"mfd-monitor-agent/internal/status"
)
// namedCollector binds a stable collector name to a collection function.
// namedCollector 将稳定的采集器名称与采集函数绑定。
type namedCollector struct {
name string
fn func(context.Context, *status.HostStatus) error
}
// Name returns the collector name used in snapshot error records.
// Name 返回用于快照错误记录的采集器名称。
func (c namedCollector) Name() string {
return c.name
}
// Collect runs the wrapped collection function.
// Collect 执行绑定的采集函数。
func (c namedCollector) Collect(ctx context.Context, out *status.HostStatus) error {
return c.fn(ctx, out)
}
// New returns the default collector set for the current platform.
// New 返回当前平台的默认采集器集合。
func New(hostID string) []snapshot.Collector {
return []snapshot.Collector{
namedCollector{name: "system", fn: func(ctx context.Context, out *status.HostStatus) error {