mirror of
https://github.com/hanzoai/status.git
synced 2026-10-30 18:21:48 +00:00
White-labelable status monitoring service with all Gatus branding removed. Defaults to neutral "Status" text. Branding is driven entirely by the ui section in config YAML. - Pure Go build (CGO_ENABLED=0, modernc.org/sqlite) - Multi-stage Dockerfile (node frontend + go backend + alpine runtime) - K8s kustomize overlays for hanzo and lux deployments - GitHub Actions CI for GHCR image push - Pre-built Vue frontend with zero upstream branding
40 lines
1000 B
Go
40 lines
1000 B
Go
package endpoint
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// Event is something that happens at a specific time
|
|
type Event struct {
|
|
// Type is the kind of event
|
|
Type EventType `json:"type"`
|
|
|
|
// Timestamp is the moment at which the event happened
|
|
Timestamp time.Time `json:"timestamp"`
|
|
}
|
|
|
|
// EventType is, uh, the types of events?
|
|
type EventType string
|
|
|
|
var (
|
|
// EventStart is a type of event that represents when an endpoint starts being monitored
|
|
EventStart EventType = "START"
|
|
|
|
// EventHealthy is a type of event that represents an endpoint passing all of its conditions
|
|
EventHealthy EventType = "HEALTHY"
|
|
|
|
// EventUnhealthy is a type of event that represents an endpoint failing one or more of its conditions
|
|
EventUnhealthy EventType = "UNHEALTHY"
|
|
)
|
|
|
|
// NewEventFromResult creates an Event from a Result
|
|
func NewEventFromResult(result *Result) *Event {
|
|
event := &Event{Timestamp: result.Timestamp}
|
|
if result.Success {
|
|
event.Type = EventHealthy
|
|
} else {
|
|
event.Type = EventUnhealthy
|
|
}
|
|
return event
|
|
}
|