refactor: agent and entities

This commit is contained in:
Henry Dollman
2024-08-14 14:14:41 -04:00
parent 083da9598e
commit c7e67a9b63
8 changed files with 168 additions and 171 deletions

View File

@@ -1,3 +1,4 @@
// Package alerts handles alert management and delivery.
package alerts
import (
@@ -32,7 +33,7 @@ func (am *AlertManager) HandleSystemAlerts(newStatus string, newRecord *models.R
return
}
// log.Println("found alerts", len(alertRecords))
var systemInfo *system.SystemInfo
var systemInfo *system.Info
for _, alertRecord := range alertRecords {
name := alertRecord.GetString("name")
switch name {
@@ -56,8 +57,8 @@ func (am *AlertManager) HandleSystemAlerts(newStatus string, newRecord *models.R
}
}
func getSystemInfo(record *models.Record) *system.SystemInfo {
var SystemInfo system.SystemInfo
func getSystemInfo(record *models.Record) *system.Info {
var SystemInfo system.Info
record.UnmarshalJSONField("info", &SystemInfo)
return &SystemInfo
}