初版功能完成
ci / Go checks (ubuntu-latest) (push) Has been cancelled
ci / Go checks (windows-latest) (push) Has been cancelled

This commit is contained in:
qsc
2026-08-29 13:12:17 +08:00
commit 142e5dc7d6
217 changed files with 21313 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
// Package logging configures structured RemLink logs and packet sampling.
package logging
// Module identifies the subsystem that emitted a log record.
type Module string
const (
ModuleCore Module = "CORE"
ModuleBootstrap Module = "BOOTSTRAP"
ModuleWG Module = "WG"
ModuleIPAM Module = "IPAM"
ModuleControl Module = "CONTROL"
ModuleSession Module = "SESSION"
ModuleRoute Module = "ROUTE"
ModuleNetstack Module = "NETSTACK"
ModuleTUN Module = "TUN"
ModuleSubnet Module = "SUBNET"
ModuleSystem Module = "SYSTEM"
)
// Modules is the complete v1 logging-module set.
var Modules = [...]Module{
ModuleCore,
ModuleBootstrap,
ModuleWG,
ModuleIPAM,
ModuleControl,
ModuleSession,
ModuleRoute,
ModuleNetstack,
ModuleTUN,
ModuleSubnet,
ModuleSystem,
}
// Valid reports whether the module belongs to the v1 logging taxonomy.
func (m Module) Valid() bool {
switch m {
case ModuleCore,
ModuleBootstrap,
ModuleWG,
ModuleIPAM,
ModuleControl,
ModuleSession,
ModuleRoute,
ModuleNetstack,
ModuleTUN,
ModuleSubnet,
ModuleSystem:
return true
default:
return false
}
}