Watch
1
0
Fork
You've already forked RedFlag
0
RedFlag/server/internal/models/maintenance_window_model.go
Fimeg 5758b26875 swap uuid lib, windows installer pass, README/RAF copy
- google/uuid -> gofrs/uuid/v5 across server + agent
- windows.go: cross-platform binding cleanup
- linux install template: disable sudo lecture for TTY-less service user
- README: XZ/SolarWinds lede, stable-release note, single attack-surface block
2026-06-03 15:39:49 -04:00

29 lines
1.1 KiB
Go

package models
import (
"time"
"github.com/gofrs/uuid/v5"
)
// MaintenanceWindow represents a recurring weekly maintenance window
// for gating update installations. DayOfWeek uses Go convention (0=Sunday).
type MaintenanceWindow struct {
ID uuid.UUID `json:"id" db:"id"`
DayOfWeek int `json:"day_of_week" db:"day_of_week"` // 0=Sunday, 6=Saturday
StartTime string `json:"start_time" db:"start_time"` // HH:MM (TIME column)
EndTime string `json:"end_time" db:"end_time"` // HH:MM (TIME column)
Description string `json:"description" db:"description"`
Enabled bool `json:"enabled" db:"enabled"`
CreatedAt time.Time `json:"created_at" db:"created_at"`
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
}
// MaintenanceWindowInput is the request body for create/update operations.
type MaintenanceWindowInput struct {
DayOfWeek int `json:"day_of_week"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
Description string `json:"description"`
Enabled *bool `json:"enabled"`
}