| | |
| | | import ( |
| | | "apsClient/conf" |
| | | "apsClient/constvar" |
| | | "apsClient/model" |
| | | "apsClient/pkg/sqlitex" |
| | | "apsClient/service" |
| | | "apsClient/service/plc_address" |
| | | "fmt" |
| | | "net" |
| | | "sync" |
| | | ) |
| | | |
| | |
| | | type Network struct{} |
| | | |
| | | func (slf *Network) Check() bool { |
| | | return false |
| | | ifaces, err := net.Interfaces() |
| | | if err != nil { |
| | | fmt.Println("Error:", err) |
| | | return false |
| | | } |
| | | var netAllFailed bool |
| | | for _, iFace := range ifaces { |
| | | if iFace.Flags == net.FlagUp { |
| | | netAllFailed = false |
| | | fmt.Printf("Interface %s is DOWN, indicating a network issue.\n", iFace.Name) |
| | | } |
| | | } |
| | | return !netAllFailed |
| | | } |
| | | |
| | | type DB struct{} |
| | |
| | | type Nsq struct{} |
| | | |
| | | func (slf *Nsq) Check() bool { |
| | | return false |
| | | old, err := model.NewSystemStatusSearch().SetKey(constvar.SystemStatusKeyNsq).First() |
| | | if err != nil { |
| | | return false |
| | | } |
| | | return old.Value == constvar.SystemStatusValueNormal |
| | | } |
| | | |
| | | type Device struct{} |