Documentation
¶
Index ¶
- type Event
- func ContainerCrashLoopEvent(project, env, service string, restartCount int, lastError string) Event
- func ContainerOOMEvent(project, env, service string, containerID string) Event
- func DeployFailedEvent(project, env, service string, err error) Event
- func DeployStartedEvent(project, env, service string) Event
- func DeploySucceededEvent(project, env, service string, duration time.Duration) Event
- func DriftDetectedEvent(project, env, service, description string) Event
- func HealthCheckFailedEvent(project, env, service string, endpoint string, statusCode int, err error) Event
- func HealthCheckRecoveredEvent(project, env, service string, endpoint string, downtime time.Duration) Event
- func HighCPUEvent(project, env, service string, cpuPercent float64, threshold float64) Event
- func HighDiskEvent(project, env string, diskPercent float64, threshold float64, ...) Event
- func HighMemoryEvent(project, env, service string, memPercent float64, threshold float64, ...) Event
- func SSLExpiringSoonEvent(project, env string, domain string, expiresAt time.Time, daysUntilExpiry int) Event
- func SSLFailedEvent(project, env string, domain string, err error) Event
- func SSLIssuedEvent(project, env string, domain string, waitTime time.Duration) Event
- func SSLPendingEvent(project, env string, domain string, cnameTarget string) Event
- func ScaleEvent(project, env, service string, fromReplicas, toReplicas int) Event
- func ServiceDownEvent(project, env, service string, err error) Event
- func ServiceUpEvent(project, env, service string, downtime time.Duration) Event
- type EventType
- type Notifier
- type NotifierConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
Type EventType `json:"type"`
Project string `json:"project"`
Environment string `json:"environment"`
Service string `json:"service,omitempty"`
Message string `json:"message"`
Details map[string]string `json:"details,omitempty"`
Timestamp time.Time `json:"timestamp"`
Duration time.Duration `json:"duration,omitempty"`
Error string `json:"error,omitempty"`
}
Event represents a notification event
func ContainerCrashLoopEvent ¶
func ContainerCrashLoopEvent(project, env, service string, restartCount int, lastError string) Event
ContainerCrashLoopEvent creates a crash loop event
func ContainerOOMEvent ¶
ContainerOOMEvent creates an out of memory event
func DeployFailedEvent ¶
DeployFailedEvent creates a deploy failed event
func DeployStartedEvent ¶
DeployStartedEvent creates a deploy started event
func DeploySucceededEvent ¶
DeploySucceededEvent creates a deploy succeeded event
func DriftDetectedEvent ¶
DriftDetectedEvent creates a drift detected event
func HealthCheckFailedEvent ¶
func HealthCheckFailedEvent(project, env, service string, endpoint string, statusCode int, err error) Event
HealthCheckFailedEvent creates a health check failure event
func HealthCheckRecoveredEvent ¶
func HealthCheckRecoveredEvent(project, env, service string, endpoint string, downtime time.Duration) Event
HealthCheckRecoveredEvent creates a health check recovery event
func HighCPUEvent ¶
HighCPUEvent creates a high CPU usage alert event
func HighDiskEvent ¶
func HighDiskEvent(project, env string, diskPercent float64, threshold float64, usedGB, totalGB int64) Event
HighDiskEvent creates a high disk usage alert event
func HighMemoryEvent ¶
func HighMemoryEvent(project, env, service string, memPercent float64, threshold float64, usedMB, totalMB int64) Event
HighMemoryEvent creates a high memory usage alert event
func SSLExpiringSoonEvent ¶
func SSLExpiringSoonEvent(project, env string, domain string, expiresAt time.Time, daysUntilExpiry int) Event
SSLExpiringSoonEvent creates an SSL expiring soon event
func SSLFailedEvent ¶ added in v0.1.3
SSLFailedEvent creates an SSL certificate failed event
func SSLIssuedEvent ¶ added in v0.1.3
SSLIssuedEvent creates an SSL certificate issued event
func SSLPendingEvent ¶ added in v0.1.3
SSLPendingEvent creates an SSL certificate pending event
func ScaleEvent ¶
ScaleEvent creates a scale up/down event
func ServiceDownEvent ¶
ServiceDownEvent creates a service down event
type EventType ¶
type EventType string
EventType represents the type of deployment event
const ( EventDeployStarted EventType = "deploy_started" EventDeploySucceeded EventType = "deploy_succeeded" EventDeployFailed EventType = "deploy_failed" EventRollbackStarted EventType = "rollback_started" EventRollbackDone EventType = "rollback_done" EventServiceDown EventType = "service_down" EventServiceUp EventType = "service_up" EventServiceRestarted EventType = "service_restarted" EventDriftDetected EventType = "drift_detected" EventBackupCompleted EventType = "backup_completed" EventBackupFailed EventType = "backup_failed" // Resource alerts EventHighCPU EventType = "high_cpu" EventHighMemory EventType = "high_memory" EventHighDisk EventType = "high_disk" EventResourceNormal EventType = "resource_normal" // Health alerts EventHealthCheckFailed EventType = "health_check_failed" EventHealthCheckRecovered EventType = "health_check_recovered" EventContainerOOM EventType = "container_oom" EventContainerCrashLoop EventType = "container_crash_loop" // SSL alerts EventSSLExpiringSoon EventType = "ssl_expiring_soon" EventSSLExpired EventType = "ssl_expired" EventSSLRenewed EventType = "ssl_renewed" EventSSLPending EventType = "ssl_pending" EventSSLIssued EventType = "ssl_issued" EventSSLFailed EventType = "ssl_failed" // Scaling events EventScaleUp EventType = "scale_up" EventScaleDown EventType = "scale_down" )
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier handles sending notifications
func NewNotifier ¶
func NewNotifier(config NotifierConfig, verbose bool) *Notifier
NewNotifier creates a new notifier
type NotifierConfig ¶
type NotifierConfig struct {
SlackWebhook string `yaml:"slackWebhook,omitempty"`
DiscordWebhook string `yaml:"discordWebhook,omitempty"`
Webhook string `yaml:"webhook,omitempty"` // Generic webhook
Email string `yaml:"email,omitempty"` // Future: email notifications
}
NotifierConfig holds configuration for notifications