feat: nbi

This commit is contained in:
simon committed 2025-05-23 18:24:18 +08:00
1 parent a5e5b3cf6e
commit 01975afe9c
31 files changed
+2338 -1538

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
package config
import (
"os"
"gopkg.in/yaml.v2"
)
type DerivedRule struct {
ParentCode int `yaml:"parentCode"`
ChildCode int `yaml:"childCode"`
}
type RelatedRule struct {
Codes []int `yaml:"codes"`
NeType string `yaml:"neType"`
TimeWindow int `yaml:"timeWindow"`
}
type AlarmRelationRules struct {
Derived []DerivedRule `yaml:"derived"`
Related []RelatedRule `yaml:"related"`
}
var RelationRules AlarmRelationRules
func LoadAlarmRelationRules(path string) error {
data, err := os.ReadFile(path)
if err != nil {
return err
}
return yaml.Unmarshal(data, &RelationRules)
}