MCPcopy
hub / github.com/eolinker/goku_lite / InitModuleStatus

Function InitModuleStatus

console/module/monitor/module.go:27–49  ·  view source on GitHub ↗

初始化监控模块的配置状态

()

Source from the content-addressed store, hash-verified

25}
26// 初始化监控模块的配置状态
27func InitModuleStatus() error {
28 modules, err := monitorModuleDao.GetMonitorModules()
29 if err != nil {
30 return err
31 }
32
33 names := ksitigarbha.GetMonitorModuleNames()
34
35
36 for _, name := range names {
37
38 if m,has:= modules[name];has{
39 if m.ModuleStatus == 1{
40 ksitigarbha.Open(name,m.Config)
41 }else{
42 ksitigarbha.Close(name)
43 }
44 }else{
45 ksitigarbha.Close(name)
46 }
47 }
48 return nil
49}
50//GetMonitorModules 获取监控模块列表
51func GetMonitorModules() ([]*MonitorModule, error) {
52 m, err := monitorModuleDao.GetMonitorModules()

Callers

nothing calls this directly

Calls 4

GetMonitorModuleNamesFunction · 0.92
OpenFunction · 0.92
CloseFunction · 0.92
GetMonitorModulesMethod · 0.65

Tested by

no test coverage detected