mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-03 20:40:25 +08:00
47 lines
837 B
Go
47 lines
837 B
Go
// Copyright 2021 GoEdge CDN goedge.cdn@gmail.com. All rights reserved.
|
|
|
|
package reporterconfigs
|
|
|
|
import (
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs/shared"
|
|
)
|
|
|
|
type ReportLevel = string
|
|
|
|
const (
|
|
ReportLevelGood ReportLevel = "good"
|
|
ReportLevelNormal ReportLevel = "normal"
|
|
ReportLevelBad ReportLevel = "bad"
|
|
ReportLevelBroken ReportLevel = "broken"
|
|
)
|
|
|
|
func FindAllReportLevels() []*shared.Definition {
|
|
return []*shared.Definition{
|
|
{
|
|
Name: "良好",
|
|
Code: ReportLevelGood,
|
|
},
|
|
{
|
|
Name: "正常",
|
|
Code: ReportLevelNormal,
|
|
},
|
|
{
|
|
Name: "不良",
|
|
Code: ReportLevelBad,
|
|
},
|
|
{
|
|
Name: "错误",
|
|
Code: ReportLevelBroken,
|
|
},
|
|
}
|
|
}
|
|
|
|
func FindReportLevelName(level ReportLevel) string {
|
|
for _, def := range FindAllReportLevels() {
|
|
if def.Code == level {
|
|
return def.Name
|
|
}
|
|
}
|
|
return ""
|
|
}
|