Files
membank/auto-check/pkg/model/model.go
张威33321 700ba91883 重构 auto-check:拆分包架构,精简 workflow 为纯调度循环
各包职责:
- config: 分类 YAML 配置
- model: Device/IP/MAC 公共类型
- discovery: 扫描 + ARP MAC 解析 + Devices 变量
- sshclient: SSH 连接
- stress: stress-ng/stressapptest 压测 + Results 变量
- report: 80mm 热敏模板/sparkline/打印 + Printed 变量
- workflow: 永久循环调度 + Start/Stop

workflow 已精简为 100 行纯编排,所有业务逻辑下沉各包
2026-08-11 20:58:19 +08:00

20 lines
503 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package model
import "fmt"
// ============================
// 公共类型 — 全包共用,唯一来源
// ============================
// Device 设备MAC 为唯一标识)
// 当前仅 IP/MAC 两个字段,后续按需扩展
type Device struct {
IP string // 当前 IPDHCP 可能变化)
MAC string // 物理地址,唯一标识,空 = 无法获取
}
// Label 设备显示名(用于日志/报告)
func (d Device) Label() string {
return fmt.Sprintf("%s (%s)", d.MAC, d.IP)
}