mirror of
https://github.com/TwiN/gatus.git
synced 2025-01-09 15:38:14 +01:00
17 lines
343 B
Go
17 lines
343 B
Go
package database
|
|
|
|
import "github.com/TwinProduction/gatus/core"
|
|
|
|
func generateEventBasedOnResult(result *core.Result) *core.Event {
|
|
var eventType core.EventType
|
|
if result.Success {
|
|
eventType = core.EventHealthy
|
|
} else {
|
|
eventType = core.EventUnhealthy
|
|
}
|
|
return &core.Event{
|
|
Type: eventType,
|
|
Timestamp: result.Timestamp,
|
|
}
|
|
}
|